Heres what you want to do:
And then just do a check and say:PHP Code:<?php
session_start();
$user = $_POST['username']; //This would be like from the login form
$result = mysql_query("SELECT * FROM usertable WHERE username = $user");
$row = mysql_fetch_array($result);
$_SESSION['yoursite_username'] = $row['username']; //This sets their username
$_SESSION['yoursite_password'] = $row['password']; //Same for the pass (encrypt it)
?>
PHP Code:<?php
session_start();
$result = mysql_query("SELECT * FROM usertable WHERE username = $user");
$row = mysql_fetch_array($result);
if($_SESSION['yoursite_username'] == $row['username']&&$_SESSION['password'] == $row['password']){
$_SESSION['yoursite_username'] = $row['username']; //This sets their username
$_SESSION['yoursite_password'] = $row['password']; //Same for the pass (encrypt it)
}
?>![]()





Reply With Quote
Cheers
everyonez
