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 login form

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 10-17-2005, 02:41 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Aug 2005
Posts: 7
maryam is an unknown quantity at this point
 



login form


please tell me how can I make a login form checking the username and password from a sql database.
maryam is offline  
Old 10-17-2005, 02:48 PM   #2 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




PHP Code:

????: NamePros.com http://www.namepros.com/programming/132600-login-form.html
if ($_POST['submit']) 


$db_host "localhost";
$db_username "xxxx";
$db_password "xxxx";
$database "xxxx";


mysql_connect(localhost,$db_username,$db_password);
@
mysql_select_db($database) or die( "Unable to select database");


$passwordbeforemd5 $_POST['password'];

$username $_POST['username'];
$password md5($passwordbeforemd5);


//Check user exists in database
$sql mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' LIMIT 1");

$login_check mysql_num_rows($sql);

if (
$login_check == "1") {
$_SESSION['logged_in'] = true;
include (
"xxxx.php");
????: NamePros.com http://www.namepros.com/showthread.php?t=132600
                                }
else {
echo 
"we could not log you in";
      }

Something like that should do it. Just replace the xxxx's with whatever is necessary.
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Closed Thread


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a small php login form TWM Programming 5 08-03-2005 10:37 AM
Paypal Settlement CMachuca The Break Room 3 07-31-2004 11:14 PM
PAYPAL Litigation johnn Domain Name Discussion 6 07-31-2004 10:51 PM
Paypal Settlement Lord The Break Room 2 07-30-2004 10:30 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:48 PM.

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