Jump to content
xisto Community
Feelay

A Simple Register Script This Is a Very Simple Register-Script

Recommended Posts

Hm...
You shouldn't use localhost. What is your host?

Usually, "localhost" is the host where the php program is being executed. The php scripts are on the remote host, and the database usually is on the same host as the php script.
Of course, you could also imagine a fully distributed situation, where the php scripts are on one host, the images are on a second host and the database is on a third host. In that case, instead of "localhost" you will have to provide the name of the computer hosting the database.
Fortunately, in most of "Linux + Apache + php + mysql" hosts, all the services are on the same physical machine, so the database is local to the system running the php script, and "localhost" is suitable for reaching the database.

Share this post


Link to post
Share on other sites

help how is this not working ????? im new btw lol


<?phpif(isset( $_POST['user'] ) &&isset( $_POST['pass'] )){if( strlen( $_POST['user'] ) < 4 ){echo "Username Must Be More Than 4 Characters.";}elseif( strlen( $_POST['pass'] ) < 4 ){echo "Passwrod Must Be More Than 4 Characters.";}elseif( $_POST['pass'] == $_POST['user'] ){echo"Username And Password Can Not Be The Same.";}else{include( 'database.php' );$username = mysql_real_escape_string( $_POST['user'] );$password = md5( $_POST['pass'] );$sqlCheckForDuplicate = "SELECT username FROM user WHERE username = '". $username."'";if( mysql_num_rows( mysql_query( $sqlCheckForDuplicate ) ) == 0 ){$sqlRegUser = "INSERT INTOuser( username, password )VALUES('". $username ."','". $password ."')";if( !mysql_query( $sqlRegUser ) ){echo "You Could Not Register Because Of An Unexpected Error.";}else{echo "You Are Registered And Can Now Login";$formUsername = $username;header ('location: Login.php');}}else{echo "The Username You Have Chosen Is Already Being Used By Another User. Please Try AnotherOne.";$formUsername = $username;}}}else{echo "You Could Not Be Registered Because Of Missing Data.";}?>



please help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.