Jump to content

[SOLVED] Register Script Help


jaku78

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.