desjardins2010 Posted December 14, 2010 Share Posted December 14, 2010 This script was working fine yesterday i havn't changed anything?? not it don't register the user upon completing the script no error, just when you hit submit it refreshes and does nothing? <?php //check for submit $submit =$_POST['submit']; //gather POST variable $fullname =strip_tags($_POST['fullname']); $email =strip_tags($_POST['email']); $username =strip_tags($_POST['username']); $password =strip_tags($_POST['password']); $password2 =strip_tags($_POST['password2']); if ($submit) { //check that fields were filled in if ($fullname&&$email&&$username&&$password&&$password2) { //check to see if our two password fields match if ($password==$password2) { $password = md5($password); // register the user //open database $connect = mysql_connect("localhost", "root", ""); mysql_select_db("users"); //begine insert $queryreg = mysql_query("INSERT INTO members VALUES ('','inet_aton('127.0.0.1')','$fullname','$email','$username','$password')"); if ($queryreg) { echo "Thanks, For Registering! Click <a href=\"index.php\">HERE</a>To Login!"; } } //otherwise if passwords don't match else { echo "<font color='red'>The passwords you entered do not match</font>"; //end of checking password } } else { echo "<font color='red'>Please enter all fields!</font>"; } } //end check for submit ?> <form action='testreg.php' method="post"> <table align="center"> <tr> <td> Your Full Name: </td> <td> <input type="text" name="fullname" value="<?php echo $fullname; ?>"> </td> </tr> <tr> <td> Email Address: </td> <td> <input type="text" name="email" value="<?php echo $email; ?>"> </td> <tr> <td> Choose Username: </td> <td> <input type="text" name="username" value="<?php echo $username; ?>"> </td> </tr> <tr> <td> Password: </td> <td> <input type="password" name="password"> </td> </tr> <tr> <td> Retype Password: </td> <td> <input type="password" name="password2"> </td> </tr> </table> <p> <center><input type="submit" name="submit" value="Register"></center> </form> Quote Link to comment https://forums.phpfreaks.com/topic/221675-this-was-working-fine/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2010 Share Posted December 14, 2010 Considering that you just put in the inet_aton() function, yes you did change something. Quote Link to comment https://forums.phpfreaks.com/topic/221675-this-was-working-fine/#findComment-1147356 Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2010 Share Posted December 14, 2010 In your code, when the query fails due to any kind of error, you don't do anything, so you don't know that an error occured. Also, inet_aton() is a mysql function in the query statement. It does not get enclosed in single-quotes as that would make it a piece of string data - the characters - i n e t _ a t o n ( ... in a string. Quote Link to comment https://forums.phpfreaks.com/topic/221675-this-was-working-fine/#findComment-1147360 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.