Guber-X Posted February 11, 2013 Share Posted February 11, 2013 (edited) I really don't know whats going on... I have other smaller forms on my site that send POST info to the Action page and work. but this on is not... This form is just a User Login form. my registration form works perfectly, just the login fails... all i get from this is of course just empty user name and password $_POST... its not sending the info after submit Form Code: <form method="post" name="userlogin" action="checklogin.php"> <table> <tr> <td> User Name: </td> <td> <input type="text" id="user_name" size="25"> </td> </tr> <tr> <td> Password: </td> <td> <input type="password" id="password" size="25"> </td> </tr> <tr> <td> <input type="submit" name="Submit" value="Login"> </td> </tr> </table> </form> checklogin.php code: <?php ob_start(); // username and password sent from form $user_name = $_POST['user_name']; $password = $_POST['password']; if(empty($user_name)){ $user_name = 'Empty User Name'; echo $user_name; die; } if(empty($password)){ $password = 'Empty Password'; echo $password; die; } $securepassword = md5($password); include('connect.php'); $sql = "SELECT * FROM member WHERE user_name='$user_name' and password='$password'"; $result = mysql_query($sql) or die('Query Failed: '.mysql_error()); // Mysql_num_row is counting table row $count = mysql_num_rows($result); // If result matched $user_name and $password, table row must be 1 row if($count==1){ // Register $user_name, $password and redirect to file "login_success.php" session_register("user_name"); session_register("password"); header("location:index.php"); } else { echo "Wrong Username or Password<br>"; echo $user_name.'<br>'.$password.'<br>'.$securepassword; } ob_end_flush(); ?> Edited February 11, 2013 by Guber-X Quote Link to comment https://forums.phpfreaks.com/topic/274366-form-post-not-sending-info-to-action-page/ Share on other sites More sharing options...
Barand Posted February 11, 2013 Share Posted February 11, 2013 None of your inputs have a name attribute. That's what gets passed in the POST with the value Quote Link to comment https://forums.phpfreaks.com/topic/274366-form-post-not-sending-info-to-action-page/#findComment-1411849 Share on other sites More sharing options...
Guber-X Posted February 11, 2013 Author Share Posted February 11, 2013 OMG... im an idiot haha... thanks its always good to get a pair of second eyes on the code sometimes... missed minor details haha. Quote Link to comment https://forums.phpfreaks.com/topic/274366-form-post-not-sending-info-to-action-page/#findComment-1411850 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.