derek412 Posted March 16, 2010 Share Posted March 16, 2010 I have this code i'm trying to modify: print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username><br> Password: <input type=password name=password><br> Remember me?<br /> <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table><br> <h3><a href='register.php'>REGISTER NOW!</a></h3><br /> <-------------- This line, I assume, needs to be deleted/changed <i><center><a href=Game Copyright ©{$year} {$set['game_owner']}.</center></i>"; print <<<OUT The line pointed out, I want to insert a clickable graphic in there. The trouble is, whenever I do, I get an error: Parse error: syntax error, unexpected T_STRING in that line. The line I inserted in place of the line above is correct, according to HTML conventions: <a href="register.php" img src="joinbutton.jpg"></a><br/> but I get that error, no matter how I change it. Am I doing something wrong? Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/ Share on other sites More sharing options...
Rifts Posted March 16, 2010 Share Posted March 16, 2010 change it to <a href="register.php"><img src="joinbutton.jpg"></a><br/> Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/#findComment-1027304 Share on other sites More sharing options...
5kyy8lu3 Posted March 16, 2010 Share Posted March 16, 2010 The line I inserted in place of the line above is correct, according to HTML conventions: <a href="register.php" img src="joinbutton.jpg"></a><br/> yea, the anchor tag and your image tag are two separate things. the way you had it, the image location was an attribute to the anchor tag, which isn't a valid attribute. (guy who posted above me shows the correct syntax) Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/#findComment-1027306 Share on other sites More sharing options...
derek412 Posted March 16, 2010 Author Share Posted March 16, 2010 Here's the code now, still getting the same error in that changed line: print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username><br> Password: <input type=password name=password><br> Remember me?<br /> <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table><br> <a href="register.php"><img src="joinbutton.jpg"></a><br/> <--------------------line error Parse error: syntax error, unexpected T_STRING <i><center><a href=Game Design/Graphics/Concept copyright ©{$year} {$set['game_owner']}.</center></i>"; print <<<OUT Could something else in the structure be causing this? Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/#findComment-1027311 Share on other sites More sharing options...
5kyy8lu3 Posted March 16, 2010 Share Posted March 16, 2010 html attributes need quotes around the value. example: <a href="this.php"></a> and you didn't have ANY lol. echo '<form action="authenticate.php" method="post" name="login" onsubmit="return saveme();">Username: <input type="text" name="username"><br> Password: <input type="password" name="password"><br> Remember me?<br /> <input type="radio" value="ON" name="save">Yes <input type="radio" name="save" value="OFF" checked>No <input type="submit" value="Submit"></form></fieldset></td></tr></table><br> <a href="register.php"><img src="joinbutton.jpg"></a><br/> <i><center><a href="Game Design/Graphics/Concept copyright ©' . $year . $set['game_owner'] . '</center></i>'; print <<<OUT Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/#findComment-1027319 Share on other sites More sharing options...
derek412 Posted March 17, 2010 Author Share Posted March 17, 2010 Solved....sorta. I'm not a PHP or HTML pro, but I know a few things, and boy this code seems very non-flexible. Yet another snippet of code i'm trying to add an image to: <!-- Begin Main Content --> EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("<b><font color=red size=+1>Your IP has been banned, there is no way around this.</font></b></body></html>"); } $year=date('Y'); print "<h3></h3> <br> <br> <table width=120%> <p><img src="frontscreenpanel.jpg" width="360" height="310" /></p> <---------------this line here giving error <td> <fieldset> <legend>Login</legend>"; Same error in the line pointed out: Parse error: syntax error, unexpected T_STRING crap. I would appreciate your insight. Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/#findComment-1027383 Share on other sites More sharing options...
5kyy8lu3 Posted March 17, 2010 Share Posted March 17, 2010 same thing as last time, attribute values need to be in quotes EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("<b><font color=\"red\" size=\"+1\">Your IP has been banned, there is no way around this.</font></b></body></html>"); } $year = date('Y'); print '<h3></h3> <br> <br> <table width="120%"> <p><img src="frontscreenpanel.jpg" width="360" height="310" /></p> <td> <fieldset> <legend>Login</legend>'; Link to comment https://forums.phpfreaks.com/topic/195495-simple-coding-problem/#findComment-1027403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.