User id is self generated and NOT encrypted, you NEED that l
This is the table I was using for that script:
CREATE TABLE user (
user_id mediumint zerofill NOT NULL default 0 auto_increment,
user_name varchar(20) NOT NULL default '',
pass varchar(30) NOT NULL default '',
email varchar(70) NOT NULL default '',
created datetime NOT NULL default '',
UNIQUE KEY (user_name),
PRIMARY KEY (user_id)
)
;
I was encrypting the password, but you might want to remove that to make it easier get the page working and just compare against password. I have no idea why you would want to have the page split into two, but this page is set up to be self posting. You could cut out the HTML portion and bring it in via an include directive in the case of an error, I suppose, but yer on yer own on that one.
THis page was also set up to post to a template named index.php. You need to change the action attribute or remove it entirely to make the page post without the template, either that or adapt from the template I used:
index.php
<?php
session_start();
// gather the $page variable
// however it might be arriving
if (isset($_POST['page'])) {
$page=$_POST['page'];
} elseif (isset($HTTP_POST_VARS['page'])) {
$page=$HTTP_POST_VARS['page'];
} elseif (isset($_GET['page'])) {
$page=$_GET['page'];
} elseif (isset($HTTP_GET_VARS['page'])) {
$page=$HTTP_GET_VARS['page'];
} else $page="welcome.php";
// assign all the extensions that might be included
$extension=array(".php",".htm",".html",".txt");
if (in_array (strrchr($page,"."), $extension) ) {
// make sure page is in local directory path
$include="./".$page;
} else $include="./".$page.".php"; // attach extension
// display the page
?>
<html><head><title>Template</title></head>
<body>
<center>
<table border='1' cellpadding='5'>
<tr><td colspan='2' align='center'>HEADER AREA</td></tr>
<tr><td>SIDE BAR</td>
<td><!-- MAIN CONTENT AREA -->
<?php if(!@include("$include")){include("./welcome.php");}?>
</td>
</tr>
<tr><td colspan='2' align='center'>FOOTER AREA</td></tr>
</center>
</body>
</html>