PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 11th, 2004, 12:03 PM
sean2004 sean2004 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 11 sean2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Need a simple PHP/MySQL Login script with no Sessions/Cookies

Hello!

I am a newbie to PHP & MYSQL. I have a login table
in MySQL username & password fields.
I am looking for a simple log in script
with no sessions & cookies stuff...pls
If login correct I hv to get redirected
to another form else display error message & ask
to re login......any immediate Help Pls...

I have looked out there on google...not even a single
simple login script for a NEWBIE...like me...

Thanks,
Sean

Reply With Quote
  #2  
Old October 11th, 2004, 11:21 PM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Canada
Posts: 331 Viper_SB User rank is Private First Class (20 - 50 Reputation Level)Viper_SB User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 h 53 m 7 sec
Reputation Power: 6
So you don't want to have anything that keeps them logged in right?

Try something like this

Your form
Code:
<form action="myfile.php" method="POST">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit" name="login" value="Login">
</form>


Code to process the form
PHP Code:
if (!empty($_POST['login'])
{
   
// connect to the database or where ever you store the user and password
   // SELECT username FROM users WHERE username = '$_POST['username']' and password = '$_POST['password']'
   // of course you MUST escape all the data you receive from the client but this shoudl get you started
   // if the user is allowed to log in
   // redirect them
   
header('Location: http://www.mysite.com/myfile.php');
   exit();


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Need a simple PHP/MySQL Login script with no Sessions/Cookies


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT