Php and Mysql login script help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back