NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page php and mysql login script help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-03-2007, 02:43 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
smilgy's Avatar
Join Date: Jan 2007
Posts: 255
smilgy is on a distinguished road
 



php and mysql login script help


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?
smilgy is offline  
Old 03-03-2007, 02:54 PM   #2 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Code:
<form method="post" action="login.php">
Username field here...
Password field here...
</form>
then in login.php....
????: NamePros.com http://www.namepros.com/programming/300814-php-and-mysql-login-script-help.html

PHP Code:
<?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.
mholt is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:04 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger