Jump to content



  • Please log in to reply
1 reply to this topic

#1 Drezard

  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts

Posted 23 May 2006 - 10:37 AM

Hello, Just wondering, How would i redirect this script (I cant use headers, it wont let me). I just need it to redirect to login_sucess.php automatically or it could say "please click here to goto login_sucess.php"

Help would be much appreciated, Thanks


if (isset($_POST['submit'])) {  // check to see if the forum has been submitted
    //  where is tasys 'submit', use the name of the submit button on the form
   // get form input
    // check to make sure it's all there
    // escape input values for greater safety
    $user = empty($_POST['user']) ? die ("ERROR: Enter a Username") : mysql_escape_string($_POST['user']);
    $pass = empty($_POST['pass']) ? die ("ERROR: Enter a Password") : mysql_escape_string($_POST['pass']);
   $sql="SELECT * FROM users WHERE user='$user' and pass='$pass'";
   // Mysql_num_row is counting table rows
   // If result matched $user and $pass, table row must be 1 row
      // Register $user, $pass and redirect to file "login_success.php" and make cookie to save user data
$_SESSION['userinfo'] = mysql_fetch_array($result);

   else {
      echo "Wrong Username or Password";




if (!isset($_POST['submit'])) {
// form not submitted

    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
    Username: <input type="text" name="user">
    Password: <input type="text" name="pass">
    <input type="submit" name="submit">


Thanks, Daniel

#2 Kris

  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 23 May 2006 - 11:26 AM

Meta refresh?
<meta http-equiv="refresh" content="0;url=login_success.php">

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users