help on loading to another page if the password is correct

  • thomas_sum
  • Beginner
  • Beginner
  • thomas_sum
  • Posts: 44

Post 3+ Months Ago

Code: [ Select ]
<?php

// database connect script.

require 'db_connect.php';

if($logged_in == 1) {
    die('You are already logged in, '.$_SESSION['username'].'.');

}


?>
 <?php

} else {    // if form hasn't been submitted

?>



 </tr>
 <tr>
  <td><h1>Login</h1>
   <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
    <table align="center" border="1" cellspacing="0" cellpadding="3">
     <tr>
      <td>Username:</td>
      <td> <input type="text" name="uname" maxlength="40"> </td>
     </tr>
     <tr>
      <td>Password:</td>
      <td> <input type="password" name="passwd" maxlength="50"> </td>
     </tr>
     <tr>
      <td colspan="2" align="right"> <input type="submit" name="submit" value="Login">
      </td>
     </tr>
    </table>
   </form>
   <?php
}
?>
   <a href="register.php">Click Here</a> if you have not register</td>
 </tr>
</table>
<h1>&</h1>
</body>
</html>
  1. <?php
  2. // database connect script.
  3. require 'db_connect.php';
  4. if($logged_in == 1) {
  5.     die('You are already logged in, '.$_SESSION['username'].'.');
  6. }
  7. ?>
  8.  <?php
  9. } else {    // if form hasn't been submitted
  10. ?>
  11.  </tr>
  12.  <tr>
  13.   <td><h1>Login</h1>
  14.    <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
  15.     <table align="center" border="1" cellspacing="0" cellpadding="3">
  16.      <tr>
  17.       <td>Username:</td>
  18.       <td> <input type="text" name="uname" maxlength="40"> </td>
  19.      </tr>
  20.      <tr>
  21.       <td>Password:</td>
  22.       <td> <input type="password" name="passwd" maxlength="50"> </td>
  23.      </tr>
  24.      <tr>
  25.       <td colspan="2" align="right"> <input type="submit" name="submit" value="Login">
  26.       </td>
  27.      </tr>
  28.     </table>
  29.    </form>
  30.    <?php
  31. }
  32. ?>
  33.    <a href="register.php">Click Here</a> if you have not register</td>
  34.  </tr>
  35. </table>
  36. <h1>&</h1>
  37. </body>
  38. </html>


The script above is a login script. i like to know what code to use and where to place it when the password is enter correctly, and it will bring the user to another page. i will be appreciate if anyone could help me....
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

please redo the script inside the \[code\] tags!
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

Oops! You missed it again! The code tage can be reached through the buttons right underneith the subject field, in between "quote" and "list".
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I fixed your first post for your thomas_sum. Remember you can click on the edit button on any of your posts to edit them. You do not have to keep posting to the same topic if you make a mistake. Simply click on the edit button below your post and make any corrections that you need to make.

Anyway I am not really sure what your problem is. Mind explaining a little bit on exactly what you are wanting help on?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

thomas_sum wrote:
The script above is a login script. i like to know what code to use and where to place it when the password is enter correctly, and it will bring the user to another page. i will be appreciate if anyone could help me....


Well that code does not really do much. You are definetely missing something like maybe db_connect.php which it calls at the very beginning with the line that says:

Code: [ Select ]
require 'db_connect.php';


Did any instructions come with your script you are trying to install? If so I recommend reading through them so you understand how the script works and maybe how to set it up.
  • thomas_sum
  • Beginner
  • Beginner
  • thomas_sum
  • Posts: 44

Post 3+ Months Ago

thanks bigwebmaster!!!
Code: [ Select ]
require 'db_connect.php';

i already have the about code
This is a login script, which i like to know wat to do if the user key in the correct password and it will bring them to another page. Hope there is someone out here could help me thanks!!!

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 134 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.