Log in

View Full Version : Just a little URL help.



Kymux
01-11-2006, 05:11 PM
Right, so in php is there a code snippet to attach something you have written in a box to appear at the end of an url.

EG.

www.morningsunshine.net/form.html (http://www.morningsunshine.net/form.html)

I want it so you type your habbo name into the box, press submit and it puts it on the end of the url of habbo.php

so it would be morningsunshine.net/habbo.php?name=WHATWASTYPEDON FORM.HTML

It's for the Habbo imager. Having a little trouble.

bomb-head (forum moderator) - Moved to coding. Please post in correct forum.

Jackboy
01-11-2006, 05:13 PM
Right, so in php is there a code snippet to attach something you have written in a box to appear at the end of an url.

EG.

www.morningsunshine.net/form.html (http://www.morningsunshine.net/form.html)

I want it so you type your habbo name into the box, press submit and it puts it on the end of the url of habbo.php

so it would be morningsunshine.net/habbo.php?name=WHATWASTYPEDON FORM.HTML

It's for the Habbo imager. Having a little trouble.


Im writting this with the knowledge that u understand forms?

Ok to attatch it...

EDIT: WITH FORMS :o


<?
if (!$_POST]){
echo ("<form name=habbo action=habbo.php method=POST>
<B>Habbo Name</B>: <input type=text name=habbo>
<BR><input type=submit value=Submit>");
}
else
{
$name = $_POST[name]
echo ("<IMG SRC=morningsunshine.net/habbo.php?name=$name");
// Made By Jackboy. I had to include this coz i iz l33t.
}
?>

:Blob
01-11-2006, 05:22 PM
This is the improved version as the version above didnt seem right



<?
if (!$_POST]){
echo ("<form name=\"habbo\" action=\"habbo.php\" method=\"POST\">
<B>Habbo Name</B>: <input type=\"text\" name=\"habbo\"><br>
<input type=\"submit\" value=\"submit\"></form>");
}
else
{
$name = $_POST[name];
echo ("<IMG SRC=\"morningsunshine.net/habbo.php?name=$name\">");
}
?>

Jackboy
01-11-2006, 05:24 PM
what a load of rubbish.

That is NO WAY improved..

Mine works perfectly. I just havn't used the "/

Woopdey woo. It still works..

U meant changed and SPECIAL (In the head) version lol

Kymux
01-11-2006, 05:26 PM
Well anyway, thanks both and +rep for your help!

Blob, when ur un-cantioned ill rep u!

Jackboy
01-11-2006, 05:26 PM
Cheers. u figured it out?

:Blob
01-11-2006, 05:30 PM
Cheers. u figured it out?

Yours didnt have a submit button. Anyway, I love making my PHP right. I just like get annoyed if it aint. Dont ask

Kymux
01-11-2006, 05:34 PM
Help me. Someone put the code posted above into that somewhere. I just need it so I type the name and it edits the url to www.morningsunshine.net/habbo.php?name=NAMEHERE (http://www.morningsunshine.net/habbo.php?name=NAMEHERE)

pls

form.html



<html>
<head>
<title>What does your Habbo look like?</title>
</head>
<body>

<form action="habbo.php?name=[name]" method="post">
Enter Habbo Name: <input type="text" name="name" /><br />
<br /><input type="submit" name="submit" value="Submit" />
<br /><br />
</body>
</html>


habbo.php



<?
header("Content-Type: image/gif");
$thumbWidth = "60";
$thumbHeight = "120";
$name = $_GET[name];
$url = "http://www.habbohotel.co.uk/habbo-imaging/collagepr?name_2_txt=0&name_2_y=-117&name_2_x=-491&h_2_dir=2&h_2_name=0&h_2_frame=0&h_2_gesture=0&h_2_action=0&h_2_y=0&h_2_x=0&name_1_txt=No%20Such%20User!&name_1_y=-597&name_1_x=-471&stampY=-1048&stampX=-1019&h_1_dir=3&h_1_name=$name&h_1_frame=0&h_1_gesture=sml&h_1_action=wav&h_1_y=1&h_1_x=0&overlay=0&overlayY=-95&overlayX=-39&logoY=-300&logoX=-300&bkg=0&bkgY=-95&bkgX=-38&bkgColor=ffffff&picH=320&picW=61&quality5&img-format=png&xml-template=imageCreator_1_name";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);
imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));
$ImgWhite = imagecolorallocate($thumbImg, 255, 255, 255);
imagefill($thumbImg, 0, 0, $ImgWhite);
imagecolortransparent($thumbImg, $ImgWhite);
imagegif($thumbImg);
imagedestroy($thumbImg);
?>

Jackboy
01-11-2006, 05:34 PM
Looool ok.

I did have a submit button :rolleyes: :rolleyes:

Looook. The "last edited on the w/e" was errr it was a admin messing about...

Yeah thats right lol

Kymux
01-11-2006, 05:35 PM
Yeah but thats what I had before I made this thread lol. It doesnt work so i type the name and it comes up with the image. I'm guessing I only edit the form!

Jackboy
01-11-2006, 05:36 PM
<html>
<head>
<title>What does your Habbo look like?</title>
</head>
<body>

<form action="habbo.php" method="post">
Enter Habbo Name: <input type="text" name="name" /><br />
<br /><input type="submit" name="submit" value="Submit" />
<br /><br />
</body>
</html>


habbo.php



<?
header("Content-Type: image/gif");
$thumbWidth = "60";
$thumbHeight = "120";
$name = $_GET[name];
$url = "www.morningsunshine.net/habbo.php?name=$name
";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);
imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));
$ImgWhite = imagecolorallocate($thumbImg, 255, 255, 255);
imagefill($thumbImg, 0, 0, $ImgWhite);
imagecolortransparent($thumbImg, $ImgWhite);
imagegif($thumbImg);
imagedestroy($thumbImg);
?>



There ya go boyo ;)

Kymux
01-11-2006, 05:44 PM
I love you. (lolz)

I already +Repped.. )::

Jackboy
01-11-2006, 05:44 PM
I love u too lol!

Kymux
01-11-2006, 05:52 PM
OMGZ the php code buggered up.

www.morningsunshine.net/form.html

I checked, it's nothing to do with how I changed the bg and stuff. I made a non edited version. Check it out !

Jackboy
01-11-2006, 05:54 PM
<html>
<head>
<title>What does your Habbo look like?</title>
</head>
<body>

<form action="habbo.php" method="post">
Enter Habbo Name: <input type="text" name="name" /><br />
<br /><input type="submit" name="submit" value="Submit" />
<br /><br />
</body>
</html>


habbo.php



<?
header("Content-Type: image/gif");
$thumbWidth = "60";
$thumbHeight = "120";
$name = $_POST[name];
$url = "http://www.morningsunshine.net/habbo.php?name=$name
";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);
imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));
$ImgWhite = imagecolorallocate($thumbImg, 255, 255, 255);
imagefill($thumbImg, 0, 0, $ImgWhite);
imagecolortransparent($thumbImg, $ImgWhite);
imagegif($thumbImg);
imagedestroy($thumbImg);
?>



Try that mate ;)

Kymux
01-11-2006, 05:55 PM
Okay ill have a go!

Jackboy
01-11-2006, 05:56 PM
good luck

EDIT: I HAVE EDITED MY LATEST SCRIPT POST UP THERE.

:Blob
01-11-2006, 05:58 PM
<html>
<head>
<title>What does your Habbo look like?</title>
</head>
<body>

<form action="habbo.php" method="post">
Enter Habbo Name: <input type="text" name="name" /><br />
<br /><input type="submit" name="submit" value="Submit" />
<br /><br />
</body>
</html>


habbo.php



<?
header("Content-Type: image/gif");
$thumbWidth = "60";
$thumbHeight = "120";
$name = $_POST[name];
$url = "http://www.morningsunshine.net/habbo.php?name=$name
";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);
imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));
$ImgWhite = imagecolorallocate($thumbImg, 255, 255, 255);
imagefill($thumbImg, 0, 0, $ImgWhite);
imagecolortransparent($thumbImg, $ImgWhite);
imagegif($thumbImg);
imagedestroy($thumbImg);
?>



Try that mate ;)

Anyone can do that with 2 lines of code.

Kymux
01-11-2006, 06:03 PM
Nooope!

<br />
<b>Warning</b>: imagecreatefrompng(http://www.morningsunshine.net/habbo.php?name=Huddle
): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in <b>/home/morning/public_html/habbo.php</b> on line <b>8</b><br />
<br />
<b>Warning</b>: imagesx(): supplied argument is not a valid Image resource in <b>/home/morning/public_html/habbo.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>: imagesy(): supplied argument is not a valid Image resource in <b>/home/morning/public_html/habbo.php</b> on line <b>10</b><br />
<br />
<b>Warning</b>: imagecopyresized(): supplied argument is not a valid Image resource in <b>/home/morning/public_html/habbo.php</b> on line <b>12</b><br />
GIF89a<x€&#255;&#255;&#255;!&#249;,<x^„&#169;&#203;&#237;&#163;œ&#180;&#218;‹&#179;&#222;&#188;&#251;†&#226;H–&#230;‰&#166;&#234;&#202;&#182;&#238;&#199;&#242;L&#215;&#246;&#231;&#250;&#206;&#247;&#254;
‡&#196;&#162;&#241;ˆL*—&#204;&#166;&#243; J&#167;&#212;&#170;&#245;Š&#205;j&#183;&#220;&#174;&#247;‹&#199;&#228;&#178;&#249;ŒN&#171;&#215;&#236;&#182;&#251;
&#203;&#231;&#244;&#186;&#253;Ž&#207;&#235;&#247;&#192;;


I got that. Oh wait, something has worked as it has put http://www.morningsunshine.net/habbo.php?name=Huddle

But its broken it loool! Just edit it like my starting thread post.

Jackboy
01-11-2006, 06:11 PM
the problem there is its trying to create a PNG from a php file.

Get the direct habbo url?

Kymux
01-11-2006, 06:15 PM
I dont understand ):

Im thick..

George Morgan
01-11-2006, 06:19 PM
It's your PHP version

Jackboy
01-11-2006, 07:06 PM
No its not morgan. Ill sort it out for u later via PM Tea mate ;)

George Morgan
01-11-2006, 07:37 PM
Yes it is. I made that cropped imager script, works fine for me and on a site I work on

http://www.habbosimple.com/habboau.php?name=Habbo

Jackboy
01-11-2006, 08:32 PM
Yah but its not his php version!

Ur trying to cropPNG or w/e it is on a .php file

Wth?

U probs used the one from habbo hotel itself? am i correct?

Kymux
01-11-2006, 08:50 PM
Yeah look in habbo.php

thats the url. i just want it so i type my habbo name and it puts the name in the url.

uber
01-11-2006, 08:57 PM
form.html


<html> <head> <title>What does your Habbo look like?</title> </head> <body> <form action="redirect.php" method="post"> Enter Habbo Name: <input type="text" name="name" /><br /> <br /><input type="submit" name="submit" value="Submit" /> <br /><br /> </body> </html>


redirect.php


<?
$name = $_GET[name];
<META HTTP-EQUIV=Refresh CONTENT='0; URL=habbo.php?name=$name'>
?>


habbo.php


<?
header("Content-Type: image/gif");
<META HTTP-EQUIV=Refresh CONTENT="0; URL=habbo.php?name=$name">
$thumbWidth = "60";
$thumbHeight = "120";
$name = $_GET[name];
$url = "http://www.habbohotel.co.uk/habbo-imaging/collagepr?name_2_txt=0&name_2_y=-117&name_2_x=-491&h_2_dir=2&h_2_name=0&h_2_frame=0&h_2_gesture=0&h_2_action=0&h_2_y=0&h_2_x=0&name_1_txt=No%20Such%20User!&name_1_y=-597&name_1_x=-471&stampY=-1048&stampX=-1019&h_1_dir=3&h_1_name=$name&h_1_frame=0&h_1_gesture=sml&h_1_action=wav&h_1_y=1&h_1_x=0&overlay=0&overlayY=-95&overlayX=-39&logoY=-300&logoX=-300&bkg=0&bkgY=-95&bkgX=-38&bkgColor=ffffff&picH=320&picW=61&quality5&img-format=png&xml-template=imageCreator_1_name";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);
imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));
$ImgWhite = imagecolorallocate($thumbImg, 255, 255, 255);
imagefill($thumbImg, 0, 0, $ImgWhite);
imagecolortransparent($thumbImg, $ImgWhite);
imagegif($thumbImg);
imagedestroy($thumbImg);
?>


edit: doesn't work

Kymux
01-11-2006, 09:33 PM
Thanks anyway ):

Kymux
01-11-2006, 11:19 PM
SORTED.

www.morningsunshine.net/habbo.html

Jackboy
02-11-2006, 05:51 AM
form.html


<html> <head> <title>What does your Habbo look like?</title> </head> <body> <form action="redirect.php" method="post"> Enter Habbo Name: <input type="text" name="name" /><br /> <br /><input type="submit" name="submit" value="Submit" /> <br /><br /> </body> </html>


habbo.php


<?
header("Content-Type: image/gif");
$thumbWidth = "60";
$thumbHeight = "120";
$name = $_POST[name];
$url = "http://www.habbohotel.co.uk/habbo-imaging/collagepr?name_2_txt=0&name_2_y=-117&name_2_x=-491&h_2_dir=2&h_2_name=0&h_2_frame=0&h_2_gesture=0&h_2_action=0&h_2_y=0&h_2_x=0&name_1_txt=$name_1_y=-597&name_1_x=-471&stampY=-1048&stampX=-1019&h_1_dir=3&h_1_name=$name&h_1_frame=0&h_1_gesture=sml&h_1_action=wav&h_1_y=1&h_1_x=0&overlay=0&overlayY=-95&overlayX=-39&logoY=-300&logoX=-300&bkg=0&bkgY=-95&bkgX=-38&bkgColor=ffffff&picH=320&picW=61&quality5&img-format=png&xml-template=imageCreator_1_name";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);
imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));
$ImgWhite = imagecolorallocate($thumbImg, 255, 255, 255);
imagefill($thumbImg, 0, 0, $ImgWhite);
imagecolortransparent($thumbImg, $ImgWhite);
imagegif($thumbImg);
imagedestroy($thumbImg);
?>

fgs fridge u plonka ;P heres a working one..

Why the hell was everyone using $_GET ? ITS $_POST

Kymux
02-11-2006, 04:20 PM
Oh no i'm sorted Jack. thanks so much for the help anyway.

Jackboy
02-11-2006, 04:52 PM
Ok matey. Close thread lol

Kymux
02-11-2006, 04:54 PM
Oh yah! Thanks for reminding!

Want to hide these adverts? Register an account for free!