Jump to content

abdulbasit29

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by abdulbasit29

  1. Below code is working fine but i need to redirect on 3 different pages and its giving me error. My table structure is as User table Email Password admin@yahoo.com 123 tariq@yahoo.com 987 bilal@yahoo.com 456 if user name is like; admin@yahoo.com the page should redirect on welcome.php if user name is like; info@aiousoft.com the page should redirect to welcome2.php and if user doesnot exist in database then give error as ELSE "user doesnot exist" thanks signin.php <html><head><title>Sign In</title></head><body> <?php include 'header.php'; ?> <?php include 'menu.php'; ?> <center> <form method="post" action="checklogin.php"> <h3>Please Signin</h3> <table width="400" border="0"> <tr><td>Email</td> <td><input name="email" type="text" id="email"></td></tr> <tr><td>Password</td> <td><input name="password" type="password" id="password"></td></tr> </table> <p><label> <input type="submit" email="submit" value="Submit"> </label><input email="reset" type="reset"> </p> </form> </center> </body> </html> checklogin.php <html><head><title>Check Login</title></head><body> <?php include 'header.php'; include 'menu.php'; $email=$_POST['email']; $password=$_POST['password']; @ $db = mysql_pconnect('localhost', 'root', ''); if (!$db) { echo 'Error: Could not connect to database. Please try again later.'; exit;} mysql_select_db('car'); $q=mysql_query("select * from user where email='".$email."' and password='".$password."' ") or die(mysql_error()); $res=mysql_fetch_row($q); if($res) { header('location:welcome.php'); } else { echo' Please signin again as your user name and password is not valid'; } ?> </body> </html> header.php menu.php
×
×
  • 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.