Monk3h Posted April 22, 2008 Share Posted April 22, 2008 Can anyone see the error? Cause i cant see what iv done wrong for the life of me. =/ Error: Parse error: syntax error, unexpected T_STRING in /home/monk3h/public_html/Jay/gamefolder/register.php on line 73 <?php include ("head.php"); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #D1BFAB; } .style1 { font-family: "Gill Sans MT"; color: #804040; } --> </style></head> ?> <?php Print"<form method=post action=register.php?action=register> <body><center> <table width='755' height='482' border='0' cellpadding='0' cellspacing='0' bgcolor='#D1BFAB'> <tr> <td height='95' colspan='3' background='images/topimg.png'> </td> </tr> <tr> <td width='42' height='395' rowspan='2' background='images/leftimg.png'> </td> <td width='676' background='images/middleimg2.png'><img src='images/banner.png' width='676' height='100' /></td> <td width='42' rowspan='2' background='images/rightimg.png'> </td> </tr> <tr> <td height='184' background='images/middleimg2.png'><table width='679' border='0' cellpadding='0' cellspacing='0'> <tr> <td height='87' colspan='2'><p align='center' class='style1'><img src='images/rmessage.png' width='500' height='150'></p> </td> </tr> <tr> <td width='96' height='22'><img src='images/ruser.png' width='150' height='20' /></td> <td width='583'><label> <input type='text' name='user' /> </label></td> </tr> <tr> <td><div align='left'><img src='images/remail.png' width='150' height='20' /></div></td> <td><input type='text' name='email' /></td> </tr> <tr> <td><div align='left'><img src='images/rpass.png' width='150' height='20' /></div></td> <td><input type='text' name='pass' /></td> </tr> <tr> <td><img src='images/rgender.png' width='150' height='20'></td> <td><label> <select name='gender'> <option>Male</option> <option>Female</option> </select> </label></td> </tr> <tr> <td height='34'><div align='left'><a href='index.php'><img src='images/back.png' width='150' height='20' border='0' /></a></div></td> <td><img src='images/signup.png' width='150' height='30' /></td> </tr> </table></td> </tr> <tr> <td colspan='3'><img src='images/bottomimg.png' width='760' height='103' /></td> </tr> </table> </center></form>"; Print"<?php if ($action == register) { if (!$user) { print "You must fill out all fields."; // Line 73 include("foot.php"); exit; } elseif (!$email) { print "You must fill out all fields."; include("foot.php"); exit; elseif (!$pass) { print "You must fill out all fields."; include("foot.php"); exit; } } $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'")); elseif ($dupe1 > 0) { print "Someone already has that username."; include("foot.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'")); elseif ($dupe2 > 0) { print "Someone already has that email."; include("foot.php"); exit; } mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register."); print "You are now registered to play, $user."; print "<br><a href=index.php>login</a>"; exit; } ?> ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/ Share on other sites More sharing options...
jonsjava Posted April 22, 2008 Share Posted April 22, 2008 <?php include ("head.php"); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #D1BFAB; } .style1 { font-family: "Gill Sans MT"; color: #804040; } --> </style></head> ?> <?php Print"<form method=post action=register.php?action=register> <body><center> <table width='755' height='482' border='0' cellpadding='0' cellspacing='0' bgcolor='#D1BFAB'> <tr> <td height='95' colspan='3' background='images/topimg.png'> </td> </tr> <tr> <td width='42' height='395' rowspan='2' background='images/leftimg.png'> </td> <td width='676' background='images/middleimg2.png'><img src='images/banner.png' width='676' height='100' /></td> <td width='42' rowspan='2' background='images/rightimg.png'> </td> </tr> <tr> <td height='184' background='images/middleimg2.png'><table width='679' border='0' cellpadding='0' cellspacing='0'> <tr> <td height='87' colspan='2'><p align='center' class='style1'><img src='images/rmessage.png' width='500' height='150'></p> </td> </tr> <tr> <td width='96' height='22'><img src='images/ruser.png' width='150' height='20' /></td> <td width='583'><label> <input type='text' name='user' /> </label></td> </tr> <tr> <td><div align='left'><img src='images/remail.png' width='150' height='20' /></div></td> <td><input type='text' name='email' /></td> </tr> <tr> <td><div align='left'><img src='images/rpass.png' width='150' height='20' /></div></td> <td><input type='text' name='pass' /></td> </tr> <tr> <td><img src='images/rgender.png' width='150' height='20'></td> <td><label> <select name='gender'> <option>Male</option> <option>Female</option> </select> </label></td> </tr> <tr> <td height='34'><div align='left'><a href='index.php'><img src='images/back.png' width='150' height='20' border='0' /></a></div></td> <td><img src='images/signup.png' width='150' height='30' /></td> </tr> </table></td> </tr> <tr> <td colspan='3'><img src='images/bottomimg.png' width='760' height='103' /></td> </tr> </table> </center></form>"; <?php if ($action == register) { if (!$user) { print "You must fill out all fields."; // Line 73 include("foot.php"); exit; } elseif (!$email) { print "You must fill out all fields."; include("foot.php"); exit; elseif (!$pass) { print "You must fill out all fields."; include("foot.php"); exit; } } $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'")); elseif ($dupe1 > 0) { print "Someone already has that username."; include("foot.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'")); elseif ($dupe2 > 0) { print "Someone already has that email."; include("foot.php"); exit; } mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register."); print "You are now registered to play, $user."; print "<br><a href=index.php>login</a>"; exit; } ?> ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524525 Share on other sites More sharing options...
Monk3h Posted April 22, 2008 Author Share Posted April 22, 2008 Parse error: syntax error, unexpected T_STRING in /home/monk3h/public_html/Jay/gamefolder/register.php on line 110 Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524528 Share on other sites More sharing options...
Monk3h Posted April 22, 2008 Author Share Posted April 22, 2008 Parse error: syntax error, unexpected '<' in /home/monk3h/public_html/Jay/gamefolder/register.php on line 70 Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524529 Share on other sites More sharing options...
Monk3h Posted April 22, 2008 Author Share Posted April 22, 2008 Removed the unneeded <?php/?> Also Changed the Elseif's to Ifs. Works now. Thanks Dude. =] Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524532 Share on other sites More sharing options...
Monk3h Posted April 22, 2008 Author Share Posted April 22, 2008 Okay now when i click Signup it wont go thru to the register action..? :S <?php include ("head.php"); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #D1BFAB; } .style1 { font-family: "Gill Sans MT"; color: #804040; } --> </style></head> ?> <?php Print"<form method=post action=register.php?action=register> <body><center> <table width='755' height='482' border='0' cellpadding='0' cellspacing='0' bgcolor='#D1BFAB'> <tr> <td height='95' colspan='3' background='images/topimg.png'> </td> </tr> <tr> <td width='42' height='395' rowspan='2' background='images/leftimg.png'> </td> <td width='676' background='images/middleimg2.png'><img src='images/banner.png' width='676' height='100' /></td> <td width='42' rowspan='2' background='images/rightimg.png'> </td> </tr> <tr> <td height='184' background='images/middleimg2.png'><table width='679' border='0' cellpadding='0' cellspacing='0'> <tr> <td height='87' colspan='2'><p align='center' class='style1'><img src='images/rmessage.png' width='500' height='150'></p> </td> </tr> <tr> <td width='96' height='22'><img src='images/ruser.png' width='150' height='20' /></td> <td width='583'><label> <input type='text' name='user' /> </label></td> </tr> <tr> <td><div align='left'><img src='images/remail.png' width='150' height='20' /></div></td> <td><input type='text' name='email' /></td> </tr> <tr> <td><div align='left'><img src='images/rpass.png' width='150' height='20' /></div></td> <td><input type='text' name='pass' /></td> </tr> <tr> <td><img src='images/rgender.png' width='150' height='20'></td> <td><label> <select name='gender'> <option>Male</option> <option>Female</option> </select> </label></td> </tr> <tr> <td height='34'><div align='left'><a href='index.php'><img src='images/back.png' width='150' height='20' border='0' /></a></div></td> <td><a href='register.php?action=register'><img src='images/signup.png' width='150' height='30' border='0' /></td> </tr> </table></td> </tr> <tr> <td colspan='3'><img src='images/bottomimg.png' width='760' height='103' /></td> </tr> </table> </center></form>"; if ($action == register) { if (!$user) { print "You must fill out all fields."; // Line 73 include("foot.php"); exit; } if (!$email) { print "You must fill out all fields."; include("foot.php"); exit; if (!$pass) { print "You must fill out all fields."; include("foot.php"); exit; } } $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'")); if ($dupe1 > 0) { print "Someone already has that username."; include("foot.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'")); if ($dupe2 > 0) { print "Someone already has that email."; include("foot.php"); exit; } mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register."); print "You are now registered to play, $user."; print "<br><a href=index.php>login</a>"; exit; } ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524541 Share on other sites More sharing options...
dezkit Posted April 23, 2008 Share Posted April 23, 2008 <?php include ("head.php"); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #D1BFAB; } .style1 { font-family: "Gill Sans MT"; color: #804040; } --> </style></head> ?> <?php Print"<form method=post action='register.php?action=register'> <body><center> <table width='755' height='482' border='0' cellpadding='0' cellspacing='0' bgcolor='#D1BFAB'> <tr> <td height='95' colspan='3' background='images/topimg.png'> </td> </tr> <tr> <td width='42' height='395' rowspan='2' background='images/leftimg.png'> </td> <td width='676' background='images/middleimg2.png'><img src='images/banner.png' width='676' height='100' /></td> <td width='42' rowspan='2' background='images/rightimg.png'> </td> </tr> <tr> <td height='184' background='images/middleimg2.png'><table width='679' border='0' cellpadding='0' cellspacing='0'> <tr> <td height='87' colspan='2'><p align='center' class='style1'><img src='images/rmessage.png' width='500' height='150'></p> </td> </tr> <tr> <td width='96' height='22'><img src='images/ruser.png' width='150' height='20' /></td> <td width='583'><label> <input type='text' name='user' /> </label></td> </tr> <tr> <td><div align='left'><img src='images/remail.png' width='150' height='20' /></div></td> <td><input type='text' name='email' /></td> </tr> <tr> <td><div align='left'><img src='images/rpass.png' width='150' height='20' /></div></td> <td><input type='text' name='pass' /></td> </tr> <tr> <td><img src='images/rgender.png' width='150' height='20'></td> <td><label> <select name='gender'> <option>Male</option> <option>Female</option> </select> </label></td> </tr> <tr> <td height='34'><div align='left'><a href='index.php'><img src='images/back.png' width='150' height='20' border='0' /></a></div></td> <td><a href='register.php?action=register'><img src='images/signup.png' width='150' height='30' border='0' /></td> </tr> </table></td> </tr> <tr> <td colspan='3'><img src='images/bottomimg.png' width='760' height='103' /></td> </tr> </table> </center></form>"; if ($action == register) { if (!$user) { print "You must fill out all fields."; // Line 73 include("foot.php"); exit; } if (!$email) { print "You must fill out all fields."; include("foot.php"); exit; if (!$pass) { print "You must fill out all fields."; include("foot.php"); exit; } } $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'")); if ($dupe1 > 0) { print "Someone already has that username."; include("foot.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'")); if ($dupe2 > 0) { print "Someone already has that email."; include("foot.php"); exit; } mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register."); print "You are now registered to play, $user."; print "<br><a href=index.php>login</a>"; exit; } ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524557 Share on other sites More sharing options...
Monk3h Posted April 23, 2008 Author Share Posted April 23, 2008 Still dosnt work.. =/ Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524561 Share on other sites More sharing options...
Monk3h Posted April 23, 2008 Author Share Posted April 23, 2008 I works in the sence that there are no errors. But when i click the register Image it goes to register.php?action=register.. But the Action, register dosnt happen. :S Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524573 Share on other sites More sharing options...
AndyB Posted April 23, 2008 Share Posted April 23, 2008 But when i click the register Image it goes to register.php?action=register.. But the Action, register dosnt happen. :S Hardly surprising. <a href='register.php?action=register'><img src='images/signup.png' width='150' height='30' border='0' /> In the first place that will NOT submit any data. In the second place, 'action' probably needs to be retrieved from the $_GET array instead of assuming that register_globals is ON (not likely in any recent php installation). Of course, that isn't going to help as nothing else is passed from that link. You need to review the html construction you're using in the form. Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524593 Share on other sites More sharing options...
Monk3h Posted April 23, 2008 Author Share Posted April 23, 2008 Didnt have Globals turned on.. Works now. I had them on in the .htaccess but for security reasons its needed in a php.ini instead. Link to comment https://forums.phpfreaks.com/topic/102425-parse-error-syntax-error-unexpected-t_string-in-homemonk3hpublic_htmljayg/#findComment-524819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.