This is the php. I know you've made comments about my continuing to use HTML, but I'm doing things as I was taught (if that's the right word). I'm using HTML with JS on the client side (or intend to), and php for server side validation and linking to MYSql.
As I said before this now logs me in using Firefox and Chrome, but achieves nothing using IE. I've spent so long on this I haven't had a chance even to read about encryption yet.
Thanks
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
if (isset($_POST['user']) && isset($_POST['upword'])){
session_start(); // MUST be at the top of every page where you need to use sessions and be before any other code in the page
$uname = mysql_real_escape_string(trim($_POST['user'])); // Prevention of sql injection
$upassword = mysql_real_escape_string(trim($_POST['upword']));
$link = mysql_connect('host.fatcowmysql.com', 'me', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('members1');
$sql=mysql_query("SELECT id FROM members WHERE user='$uname' and password='$upassword' LIMIT 1");
$result=mysql_fetch_array($sql);
if ($result) {
$_SESSION['username'] = $uname;
$_SESSION['user_id'] = $result['id'];
header('location:members.html');
} else {
// If this PHP is in the same page as your login
echo"Sorry, your credentials are not valid, Please try again.";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
etc



