Jump to content
xisto Community

silence

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. Thanks, here's the regcheck: <?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 INTO user( 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 Another One."; $formUsername = $username; } }}else{ echo "You Could Not Be Registered Because Of Missing Data.";}?>
  2. <?$con = mysql_connect('---','---','---');if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db('register_database');?>
  3. I'm not sure... I looked it up here: http://webcheatsheet.com/PHP/connect_mssql_database.php and followed the instructions, but it still won't work. I really have no idea what I'm looking for. How can I tell if I'm connected?
  4. Hi, I'm trying to use this code as a beginner, so this is probably a stupid question, but... I've gotten the script to work up to the regcheck part. And the regcheck errors work too. But when I try to register with an actual account, for example a password and username that are different and are both longer than four letters, I get this error message: What's going on, and how do I fix this?
×
×
  • 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.