June 3, 201412 yr Hello Folks! I need some direction. I am not very good with PHP but can do well with following tutorials. I am trying to make a simple login page that uses only one or two different passwords. Please help! :-) Any great sites that help with this? Any videos that you would suggest? Thanks in advance.
June 6, 201412 yr Hi Buddy For that you just need to learn $_POST variables and If statements 1) Set up a form on your HTML page target="nameofphpfile.php" method="post" 2) Inside "nameofphpfile.php" have the following $actual_user = 'tom'; $actual_password = 'tomspass'; $entered_username = $_POST['username']; $entered_password = $_POST['password']; 3) Then we check that the POST variables match the user and pass we set so we would put if($entered_username == $actual_user && $entered_password == $actual_password){ // User has now logged in } The concept is here, but its very very basic at the minute. if your wanting to create a login section which keeps the user logged into the website whilst they're browsing etc, you need to learn sessions and mysql; Anyway if you want any help drop me a PM, im happy to help T
Create an account or sign in to comment