Posted: Wed Jun 07, 2006 4:26 pm
Simplified, but maybe something like:
mypagetemplate.php:
Code: Select all
$content = '';
$link = mysql_connect( $host, $user, $pass );
mysql_select_db( $dbname );
if( $errmsg = mysql_error($link)){
$content .= error("Could not connect to database. ($errmsg)");
} else {
$username = trim($_POST['username']);
$userpass = trim($_POST['userpass']);
$query = "SELECT * FROM $table WHERE username = '$username' AND userpass = '$userpass'";
$result = mysql_query( $query );
if( !$result ){
$content .= error('You are not registered.');
} else{
$content .= Success();
}
mysql_free_result( $result );
mysql_close( $link );
}
include 'mypagetemplate.php';Code: Select all
<html>
<head>
.....
</head>
<body>
- header here
-- left nav bar here
<?php echo $content; ?>
-- footer here
</body>
</html>