Hi, i have a quick question. I am trying to build and easy login screen with username and password using PHP. The login screen should contain client side checking written in javascript and it should be able to perform server side checking. Do you know how i can do this? I am using Dreamweaver which has PHP functionality built in.
This question is somewhat vague? Can you be a little more specific about a PHP question you are having? In general your form will have an action="{some php script}" and method="post". You can add an onsubmit attribute to the form and specify a javascript function that checks for things like fieldname.value!='' and returns false if those checks fail. The php script can compare the values against hard coded ones, or a database, or a text file. Check out some of the webmonkey.com PHP tutorials. At least one deals with login scripts.
i wanted to create a basic login screen using php and client-side checking written in javascript and also som server side checking. Can give me some examples on how i will be able to create. I have dreamweaver and PHPDEV5. thanks
ignore the earlier question this is where i am at: i have connected PHP to Access and created a login screen
$odbc = odbc_connect ('PHP Login', 'root', '') or die( "Could Not Connect to ODBC Database!" );
?>
//get variables from login screen.mdb
$user = $_POST['user'];
$pass = $_POST['pass'];
$sql = "SELECT * FROM login screen WHERE username_column = 'user" . $_POST['username'] . "' AND password_column = 'pass" . $_POST['password'] . "'"
also do u know how i can do a process.php script as i dont know if what i am doing is a process.php? Also how can i verify users and redirect them to a website? thanx
The code you have above would be appropriate in a process.php script. If you have login.php with a form pointing to process.php you would put your sql above into process. Then it's a matter of running the query and seeing of you got a row back.
Thanx. so far this is what i have done: I put everything into one place:
$odbc = odbc_connect ('PHP Login', 'root', '') or die( "Could Not Connect to ODBC Database!" );
?>
//get variables from login screen.mdb
$user = $_POST['user'];
$pass = $_POST['pass'];
$sql = "SELECT * FROM login screen WHERE username_column = 'user" . $_POST['username'] . "' AND password_column = 'password" . $_POST['password'] . "'"
?>
so do i need to create a new file and put the script you gave me in there or can i somehow fit it in here? Please make any modifications to the code. Thanx
Thanx. so far this is what i have done: I put everything into one place:
$odbc = odbc_connect ('PHP Login', 'root', '') or die( "Could Not Connect to ODBC Database!" );
?>
//get variables from login screen.mdb
$user = $_POST['user'];
$pass = $_POST['pass'];
$sql = "SELECT * FROM login screen WHERE username_column = 'user" . $_POST['username'] . "' AND password_column = 'password" . $_POST['password'] . "'"
?>
so do i need to create a new file and put the script you gave me in there or can i somehow fit it in here? Please make any modifications to the code. Thanx
Hi one more question, i heard that ODBC_NUM_ROWS dont work with access also, how do i validate users and when validated, take them to a website? thanks for your contributions so far