slapdashgrim Posted July 17, 2007 Share Posted July 17, 2007 I need help please. when i try and load my page it says http://grimhq.com/grimspace/signup.php here is the code. <? ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); If (isset($_post['submit'])){ $problem = FALSE; if (empty ($_post['username'])){ $problem = TRUE; print'<p>Please enter a <b>username</B></p>'; } if(empty ($_post['password1'])){ $problem=true; print '<p>Please enter a password</p>'; } if($_post['password1']!=$_post['password2']){ $problem=true; print '<p>Please confirm your password, or they did not match</p>'; } if (!$problem){ if($fp = fopen ('users/users.txt', 'ab')){ $dir = time() . rand (0, 4596); $data = $_post['username'] . "\t" . crypt ($_post['password1']) . "\t" . $lname . "\t" . $fname . "\t". $dir . "\r\n" fwrite ($fp, $data); fclose ($fp); mkdir ("users/$dir"); print '<p>You are now registerd</p>'; } else { print "<p>Sorry you could not be registerd due to a system error.</p>"; }else{ //forgot a field print "<p>Please try again.</p>"; ?> <form action="signup.php" method=get><p> Username: <input type=text name="username" size=20><br> First name:<input type="text" name="fname" size=20 value="" maxlength="255"><br> Last name:<input type="text" name="lname" value="" maxlength="255"><br> Password:<input type="password" name="password1" value="" maxlength="255"><BR> Confrirm password:<input type="password" name="password2" value="" maxlength="255"><br> <input type=submit name=submit value=Register> </form> <? } ?> Link to comment https://forums.phpfreaks.com/topic/60321-solved-t_string-error/ Share on other sites More sharing options...
slapdashgrim Posted July 17, 2007 Author Share Posted July 17, 2007 the line that has the error is fwrite ($fp, $data); Link to comment https://forums.phpfreaks.com/topic/60321-solved-t_string-error/#findComment-300096 Share on other sites More sharing options...
lur Posted July 17, 2007 Share Posted July 17, 2007 Missing semicolon on line 26, double ELSE on line 35. Link to comment https://forums.phpfreaks.com/topic/60321-solved-t_string-error/#findComment-300097 Share on other sites More sharing options...
tapos Posted July 17, 2007 Share Posted July 17, 2007 Try this <? ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); If (isset($_post['submit'])){ $problem = FALSE; if (empty ($_post['username'])){ $problem = TRUE; print'<p>Please enter a <b>username</B></p>'; } if(empty ($_post['password1'])){ $problem=true; print '<p>Please enter a password</p>'; } if($_post['password1']!=$_post['password2']){ $problem=true; print '<p>Please confirm your password, or they did not match</p>'; } if (!$problem){ if($fp = fopen ('users/users.txt', 'ab')){ $dir = time() . rand (0, 4596); $data = $_post['username'] . "\t" . crypt ($_post['password1']) . "\t" . $lname . "\t" . $fname . "\t". $dir . "\r\n"; fwrite ($fp, $data); fclose ($fp); mkdir ("users/$dir"); print '<p>You are now registerd</p>'; } else { print "<p>Sorry you could not be registerd due to a system error.</p>"; }}else{ //forgot a field print "<p>Please try again.</p>"; ?> <form action="signup.php" method=get><p> Username: <input type=text name="username" size=20><br> First name:<input type="text" name="fname" size=20 value="" maxlength="255"><br> Last name:<input type="text" name="lname" value="" maxlength="255"><br> Password:<input type="password" name="password1" value="" maxlength="255"><BR> Confrirm password:<input type="password" name="password2" value="" maxlength="255"><br> <input type=submit name=submit value=Register> </form> <? } ?> -- Tapos Pal Link to comment https://forums.phpfreaks.com/topic/60321-solved-t_string-error/#findComment-300099 Share on other sites More sharing options...
slapdashgrim Posted July 17, 2007 Author Share Posted July 17, 2007 Thank you both! Link to comment https://forums.phpfreaks.com/topic/60321-solved-t_string-error/#findComment-300101 Share on other sites More sharing options...
slapdashgrim Posted July 17, 2007 Author Share Posted July 17, 2007 okay now i have another problem ... it says that i have a unexpected $ on line 198 witch reads </html> The last line why? Link to comment https://forums.phpfreaks.com/topic/60321-solved-t_string-error/#findComment-300106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.