--ss-- Posted February 16, 2008 Share Posted February 16, 2008 Well I recently started learning php so I haven't got much knowledge. Anyway I wrote an simple script for my friend which uses GD libary to make an dynamic image sig, I tried expanding it so people can choose different designs for the sig and well i'm getting problems getting it to work. Here's the script: <?php if $_GET['id'] == "1" { header("Content-type: image/png"); $habbo = $_GET['name']; $hotel = $_GET['hotel']; $im = imagecreatefromgif("back.gif"); $in = imagecreatefromgif("http://www.habbo.$hotel/habbo-imaging/avatarimage?user=$habbo&action=&direction=3&head_direction=3&size=l&img_format=gif"); $in_x = imagesx($in); $in_y = imagesy($in); imagecopymerge($im,$in,200,0,0,0,$in_x,$in_y,100); imagepng($im); imagedestroy($im); } elseif $_GET['id'] == "2" { header("Content-type: image/png"); $habbo = $_GET['name']; $hotel = $_GET['hotel']; $im = imagecreatefromgif("images/2.gif"); $in = imagecreatefromgif("http://www.habbo.$hotel/habbo-imaging/avatarimage?user=$habbo&action=&direction=3&head_direction=3&size=l&img_format=gif"); $in_x = imagesx($in); $in_y = imagesy($in); imagecopymerge($im,$in,165,0,0,0,$in_x,$in_y,100); imagepng($im); imagedestroy($im); } elseif $_GET['id'] == "3" { header("Content-type: image/png"); $habbo = $_GET['name']; $hotel = $_GET['hotel']; $im = imagecreatefromgif("images/3.gif"); $in = imagecreatefromgif("http://www.habbo.$hotel/habbo-imaging/avatarimage?user=$habbo&action=wav&direction=3&head_direction=3&size=l&img_format=gif"); $in_x = imagesx($in); $in_y = imagesy($in); imagecopymerge($im,$in,382,-17,0,0,$in_x,$in_y,100); imagepng($im); imagedestroy($im); } else $_GET['id'] == "4" { header("Content-type: image/png"); $habbo = $_GET['name']; $hotel = $_GET['hotel']; $im = imagecreatefromgif("images/4.gif"); $in = imagecreatefromgif("http://www.habbo.$hotel/habbo-imaging/avatarimage?user=$habbo&action=&direction=2&head_direction=2&size=l&img_format=gif"); $in_x = imagesx($in); $in_y = imagesy($in); imagepng($im); imagedestroy($im); } ?> I should be able to type http://www.shanes.sawhosting.com/hhgs/sig.php?name=--ss--&hotel=co.uk&id=1 in the url / get an form to do it for me but I keep getting errors such as Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /home/shanessa/public_html/hhgs/sig.php on line 2 Can someone fix it up for me Quote Link to comment Share on other sites More sharing options...
nikefido Posted February 16, 2008 Share Posted February 16, 2008 wrap () around your conditionals for instance if ($_GET['id'] == 1) { //do stuff } Quote Link to comment Share on other sites More sharing options...
--ss-- Posted February 16, 2008 Author Share Posted February 16, 2008 wrap () around your conditionals for instance if ($_GET['id'] == 1) { //do stuff } Wow didn't realise the problem was so minor like that , Thanks a ton Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.