Hey everyone

I've made this website and want to use PHP to allow users to register and login. I've created a database and connected to it, i've also created the table to store data from the registration page.

I've tested it and PHP for the registration page seems to be working, when a enter my data and click submit and page is then returned saying "1 record added". The problem i'm having is with the login page. I enter the same details used to register and click submit. Instead of logining me in it takes ages to loads and then IE just says "page cannot be found"

Can anyone please help me figure out why it isn't working?

All help is greatly appreciated

Heres my coding

insert.php (registration page)

$con = mysql_connect("localhost","u08103765","aliasurn"); 
if (!$con) 
die('Could not connect: ' . mysql_error()); 
mysql_select_db("u08103765", $con); 
$sql="INSERT INTO member (firstname, surname, email, password, address1, address2, address3, postcode, telephonenumber, mobilenumber) 
if (!mysql_query($sql,$con)) //we call the function 
{ // inside IF statement 
die('Error: ' . mysql_error()); // to check and 
echo ("1 record added"); // get some feedback 

that works fine and saves the data correctly in the table

login.php - this is the code i use to try and login but everytime i try it fails..

<?php $host="localhost"; // Host name    
$dbusername="u08103765"; // Mysql username    
$dbpassword="aliasurn"; // Mysql password    
$db_name="u08103765"; // Database name    
$tbl="member"; // Table name    
// This connects to server and then selects the members databse.    
mysql_connect("$host", "$dbusername", "$dbpassword")or die("cannot connect");    
mysql_select_db("$db_name")or die("cannot select DB");    
// Assign the username and password from the form to variables.    
$sql="SELECT * FROM $tbl WHERE username='$email' and password='$password'";    
// This counts to see how many rows were found, there should be no more than 1    
// If result matched $email and $pass, table row must be 1    
// Register $email, and redirect to file "login_success.php"    
$_SESSION["logged"] = 1;    
else {    
$_SESSION["logged"] = 0;    

login_success.php - this is the page i want the logged in member to be redirected to

// Check to see if session is not registered, if it is not redirect the user back to the notloggedin.php file.    
// Put this code in first line of every web page that you only want logged-in users to see.    
<?php session_start();    
if($_SESSION['logged'] != 1){ header("location:login.php"); }    



<meta http-equiv="REFRESH" content="5;url=http:"...members.html"> 


I know ...members.html isnt a proper link but i still need to create the page so i can fill that in later

Hope you can help me

did you echo the count and see if it is getting a value ?

first off i would not show your username and pasword for your
db security issue

did you echo the count and see if it is getting a value ?

How do i do that? (sorry im not very good with php! i followed a tutorial for most of this)