help on loading to another page if the password is correct

  • thomas_sum
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Aug 20, 2003
  • Posts: 44
  • Status: Offline

Post August 20th, 2003, 6:58 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 20th, 2003, 6:58 pm

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post August 20th, 2003, 7:08 pm

please redo the script inside the \[code\] tags!
Pixel Acres V2
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post August 20th, 2003, 8:12 pm

Oops! You missed it again! The code tage can be reached through the buttons right underneith the subject field, in between "quote" and "list".
Pixel Acres V2
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post August 21st, 2003, 12:55 am

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?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post August 21st, 2003, 1:57 am

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.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • thomas_sum
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Aug 20, 2003
  • Posts: 44
  • Status: Offline

Post August 21st, 2003, 2:17 am

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 239 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.