Dynadot โ€” .com Registration $8.99

Php and Mysql login script help

Spaceship Spaceship
Watch

smilgy

Established Member
Impact
4
hi, i searched all around namepros and couldnt anything to do with mysql and php login systems, i was looking for something simple

any suggestions?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Code:
<form method="post" action="login.php">
Username field here...
Password field here...
</form>

then in login.php....

PHP:
<?php

//Start the session variable.
session_start();
//Put that line at the very top of every file
//that you need to be logged in for, or 
//uses session vars.

if (!$_POST['username_textbox_name_here'] || !$_POST['password_textbox_name_here'])
{
echo("ERROR > Please type a username and password");
exit;
}
/*
At this point, you want to verify the login information
against stored data. This could be hard-coded here if
you have 1 or 2 permanent users, or checked with a database.
If you need help there are examples around the Internet.
*/

//If the login is good, then set the session variable
$_SESSION['loginname'] = $uname;
//...or something to that extent.

//To check the login, make sure the session var is set
//to a good value.
?>

If you need details or further examples, the Internet has this all *over* the place. If you have a question, go ahead and reply/ask.
 
0
•••
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back