jaku78 Posted March 31, 2007 Share Posted March 31, 2007 I'm still starting PHP for the most part and I've been trying to make a register script for the day and I'm having some trouble, whenever the script runs from a form pre-created this is what appears. Parse error: syntax error, unexpected '{' in dir/check.inc on line 8 This is talking about a included file that holds functions to check the user name. <?php //USERNAME CHECK function usercheck($usercheckname) { if(!ereg("^[A-Za-z -]+$",$usercheckname) { echo "Invalid Username. Try again."; die(); } else { echo "Username Success"; return $usercheckname; } } Now it hasn't even finished through the whole included file yet, but always stops at that line 8, and if I take that off the whole IF statement would not work I believe... Help is appreciated greatly. Link to comment https://forums.phpfreaks.com/topic/45090-solved-register-script-help/ Share on other sites More sharing options...
fert Posted March 31, 2007 Share Posted March 31, 2007 if(!ereg("^[A-Za-z -]+$",$usercheckname) should be if(!ereg("^[A-Za-z -]+$",$usercheckname)) Link to comment https://forums.phpfreaks.com/topic/45090-solved-register-script-help/#findComment-218873 Share on other sites More sharing options...
jaku78 Posted March 31, 2007 Author Share Posted March 31, 2007 Thank you! That worked! Link to comment https://forums.phpfreaks.com/topic/45090-solved-register-script-help/#findComment-218875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.