June 24, 200719 yr Ok the problem i am having is that i am creating a registration page for a members area, but i can't get the registration form working, i don;t know if there is an error in the code or if it is just not connecting but it doesn't seem to work and i can't figure out what the problem is. this is the code i have <?phpmysql_connect("https://phpmyadmin-dublin.purplecloud.com/", "username", "password") or die(mysql_error()); mysql_select_db("Database_Name") or die(mysql_error()); if (isset($_POST['submit'])) { if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { die('You did not complete all of the required fields'); } if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 != 0) { die('Sorry, the username '.$_POST['username'].' is already in use.'); } if ($_POST['pass'] != $_POST['pass2']) { die('Your passwords did not match.'); } $_POST['pass'] = md5($_POST['pass']); if (!get_magic_quotes_gpc()) { $_POST['pass'] = addslashes($_POST['pass']); $_POST['username'] = addslashes($_POST['username']); } $insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $add_member = mysql_query($insert); ?> <h1>Registered</h1> <p>Thank you, you have registered - you may now login</a>.</p> Is there anyone who could please help me with this issue
June 25, 200719 yr Ok the problem i am having is that i am creating a registration page for a members area, but i can't get the registration form working, i don;t know if there is an error in the code or if it is just not connecting but it doesn't seem to work and i can't figure out what the problem is. this is the code i have Is there anyone who could please help me with this issue is this externally hosted? If not, try typing 'localhost' instead of https://phpmadmin-blah.........
August 6, 200719 yr PHP's error_reporting is a wonderful tool, learn to use it. Try doing this: error_reporting(E_ALL); at the top of the page, do a string replace for any @ symbols in the script, run it, and tell us the output.
August 6, 200719 yr ok, heres a chance. You are using | rather than || for OR in your IFs generally speaking, if its in an IF then it will be two chars long.
Create an account or sign in to comment