Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Databasing
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-25-2009, 12:37 PM
  #1
eugene3.1
Novice (Level 1)
 
Join Date: Dec 2008
Posts: 10
iTrader: (0)
eugene3.1 is an unknown quantity at this point
php mysql login form

I have a very simple register and login form, it's only one field, Email address.
I got the register side working and all the info goes into a mysql table.
However, the login side of the form doesn't work. I've tried various code bits but being a noob at php it's kinda tricky. The latest bit I've been trying is:

<?
session_start();
if(!isset($_POST['ok'])) {
}
else{
$db=mysql_connect('*host*', '*user*', '*pass*');
mysql_select_db('*database*', $db);
$res=mysql_query("SELECT * FROM *tablename* WHERE email='".$_POST['email']."', $db);
if(mysql_num_rows($res)!=1){
echo "Invalid email entered";
}
else{
$_SESSION['email']=$_POST['email'];
Header("Location: gallery.html");
}
mysql_close();
}
?>


thanks,

E
eugene3.1 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-26-2009, 01:25 PM
  #2
prasanthmj
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 34
iTrader: (0)
prasanthmj is an unknown quantity at this point
what exactly is the problem?
Here is a tutorial if it helps:
Making a login form using PHP
prasanthmj is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


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



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 04:20 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.