Jump to content


Photo

[SOLVED] Making a PHP Login page with a MySQL database


  • Please log in to reply
4 replies to this topic

#1 alexville

alexville
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts

Posted 17 February 2006 - 12:46 AM

Ok, I already have a way for people to register (insert data) into the database. But I wish to create a PHP login script. I'm completly lost with this part and I am hopeing you guys arnt. :-D

Here is my database setup:
SQL result

Host: localhost
Database: alexg_web
Generation Time: Feb 16, 2006 at 06:44 PM
Generated by: phpMyAdmin 2.6.4-pl2 / MySQL 4.1.14-standard
SQL query: SELECT * FROM `Citizens` LIMIT 0, 30;
Rows: 1
id     Firstname     Lastname     Username     Password     Email     Invision
1     Austin     Grenier     AustinRocks     carcar     austin@austin.com     on

If someone could help that would be great!

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 17 February 2006 - 04:34 AM

Are you familiar with the concept of session handling? If no, that's what you need to investigate.

If yes, what about logging in has you hung up?

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 17 February 2006 - 08:37 AM

What's wrong with "SELECT * FROM citizens WHERE username='$user' and password='$pass'" and checking to see if anything matches?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 alexville

alexville
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts

Posted 17 February 2006 - 02:01 PM

Ok thanks for your help, but can someone make me a example script?

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 17 February 2006 - 08:51 PM

PHP is not my forte -- I'm sure someone else can give you some psuedo-code or recommend a good tutorial. Good luck.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users