Current location: Hot Scripts Forums » Programming Languages » PHP » Simple Login Script Help


Simple Login Script Help

Reply
  #1 (permalink)  
Old 04-29-06, 08:36 PM
dflowers dflowers is offline
New Member
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Simple Login Script Help

Hello and thank you for taking the time to help me. I am very new to PHP/MySQL and I have seen several examples of login scripts that allow you to control access to pahes, etc, but I need something a little different. I need to be able to have a user login using a username and password I supply to them and then have the script check their username and password and if it is correct, it returns the contents of a third field named "pincode". Any ideas on how to do this? I am not even really sure where to begin. I am really looking for an explanation on how to accomplish this, not a ready made script. It is important to me that I understand how to code this script. Thank you in advance. Dorian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-29-06, 10:38 PM
Kethinov Kethinov is offline
New Member
 
Join Date: Apr 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
In order to accomplish this on a single page, you simply need to know how to make forms and handle the $_POST variables. If you want to be able to have users login and track their session across multiple pages, you'll need to learn how to use $_SESSION variables as well.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-10-06, 07:52 PM
codywallis codywallis is offline
New Member
 
Join Date: May 2006
Location: Kali
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Put all this code in one PHP file.

Ok here's is the form code
PHP Code:

<form action="" method="POST">

Username: <input type="text" name="username"><br>
Password: <input type="text" name="password"><br>
<?php echo $pincode?>
<br>
<input type="submit" name="Submit" value="Submit">
Here is the php code
PHP Code:



<?php

         
if(isset($Submit)) {
          
             if(
$_POST['username']=='codywallis' && $_POST['password']=='codywallis') {
             
$pincode="Pin code: <input type='text' name='pincode'>";
             }
}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 08:15 AM
Simple login script stiankr Script Requests 0 04-25-06 08:16 AM
i need a simple login and registration php script plz lunarboi Script Requests 3 01-03-06 01:04 AM
Login Script problem Justin171985 Script Requests 0 07-02-05 01:10 AM
In need of simple php login script asap j0e Script Requests 2 01-11-05 06:07 PM


All times are GMT -5. The time now is 06:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.