Since there has been many inquiries/posts regarding login and sessions, I decided to create and test some scripts to share.
I've made a mock-up site consisting of 8 pages:
Code:
auth.php // the meat and potatoes of this subject
connect.php // an excellent connection script
logout.php // destroy session and re-direct to login
nav.php // navigation include for site
index.php // main page of site
link_1.php // page of site
link_2.php // page of site
link_3.php // page of site
Here is the SQL Schema for the table I Query:
Code:
CREATE TABLE users (
user_id int(10) unsigned NOT NULL auto_increment,
username varchar(20) NOT NULL default '',
password varchar(20) NOT NULL default '',
PRIMARY KEY (user_id)
) TYPE=MyISAM;
if you copy and paste these files into your favorite text editor, edit the connect.php with your mysql settings, it should work on your server if sessions are supported.
Due to a limit in characters per post, I will post the source for each page in its own post.