you mean this:
//HTML Form to log in...
<form action="login.php" method="post">
Username <input type="text" name="user"><br />
Password <input type="password" name="pass"><br />
<input type="submit" name="submit" value="login"></form>
//end of form
//login.php
#check if account exists
$qstring="SELECT * FROM users WHERE username = '";
$qstring.=$POST['user']."' AND password = '".$POST['pass']."'");
$qry = mysql_query($qstring);
$numrows = mysql_num_rows($qry);
if($numrows < 1){ // If no return fr. database, the account doesn't exist....
}else{
session_start(); // start the session...
$SESSION['user'] = $POST['user']; // Registers the session user. If the POSTed username was "badman",
// then $_SESSION['user']=="badman"
}
//End of Validating
//The Check log
function checkLog(){
global $_SESSION;
if(session_is_registered("user")){
#add code to validate the user in the db
}else{
session_unregister("user"); // unregister the session
header("location: index.php"); // send them to the "home page"....
}
}
plugged it into 1st page, looked at preview and half the code shows up under the login/password box