Jump to content

GRD_98

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by GRD_98

  1. It wasn't at first I had to fix the errors like you said! But now its working!
  2. Thank You!!! I should have known better! Not sure how I got off track though because I was under local host with the login.php because it was working. Oh well my problem is fixed.. Thanks again!
  3. file:///C:/xampp/htdocs/lesson1/login_register/register.php
  4. Well this is what I have so far. I haven't finished the tutorial yet because when it wasn't working I didn't go any further. Here is the index page <html> <form action="login.php" method='POST'> Username: <input type='text' name='username'><br /> <br /> Password: <input type='password' name='password'><br /> <input type='submit' value='Log in'> </form> <p>Not already a member? Click <a href='register.php'>here</a> to register!</p> </html> There here is the login.ohp ( this one works great) <?php $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { $connect = mysql_connect("localhost", "root", "q9pl8mq") or die("Couldn't connect to server."); mysql_select_db("phplogin") or die("Database Not Found"); $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } //check to see if it matches if($username==$dbusername&&$password==$dbpassword) { echo"Login Successfull!"; } else echo"Password Incorrect"; } else die("Username doesn't exist!"); } else die("Please enter your username and password!"); ?> Then the register.php thats NOT working but can't figure out why... <?php $submit = $_POST['submit']; $fullname = strip_tags($_POST['name']); $username = strip_tags($_POST['user']); $password = strip_tags($_POST['password']); $verifypassword = strip_tags($_POST['verifypassword']); $date = date("Y-m-d"); if ($submit) { if($fullname&&$username&&$password&&$verifypassword) { password = md5($password); verifypassword= = md5($verifypassword); } else echo "Please fill in all fields!"; } ?> <html> <form action='register.php' method='POST'> <table> <tr> <td>Full Name:</td> <td><input type='text' name='name'></td> </tr> <tr> <td>Username:</td> <td><input type='text' name='user'></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='password'></td> </tr> <tr> <td>Verify Password:</td> <td><input type='password' name='verifypassword'></td> </tr> </table> <p><input type='submit' name='submit' value='Submit'></p> </form> </html> [attachment deleted by admin]
  5. Shows nothing at all I know, I should of been more clear. When you input nothing it should echo "Please fill in all fields" and its not doing that...You can try to echo anything and it wont work. Header isn't working either.....Thats what I cant figure out.
  6. Ok, I am a complete noob when it comes to php. I am slowly learning it but I turned to youtube for a tutorial on a registration/login page. I found a good tutorial but for some reason my php is NOT working. I have it exactly the way he does but it wont echo anything or work at all. The login page worked great in his tutorial. What do I have wrong? I cant figure it out. Please help! echo "<h1>Register</h1>"; $submit = $_POST['submit']; $fullname = strip_tags($_POST['name']); $username = strip_tags($_POST['user']); $password = strip_tags($_POST['password']); $verifypassword = strip_tags($_POST['verifypassword']); $date = date("Y-m-d"); if ($submit) { if($fullname&&$username&&$password&&$verifypassword) { password = md5($password); verifypassword= = md5($verifypassword); } else echo "Please fill in all fields!"; } <html> <form action='register.php' method='POST'> <table> <tr> <td>Full Name:</td> <td><input type='text' name='name'></td> </tr> <tr> <td>Username:</td> <td><input type='text' name='user'></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='password'></td> </tr> <tr> <td>Verify Password:</td> <td><input type='password' name='verifypassword'></td> </tr> </table> <p><input type='submit' name='submit' value='Submit'></p> </form> </html> [attachment deleted by admin]
×
×
  • 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.