Biyernes, Marso 22

How to make simple Php login form without using a database

In order to create a simple log in and log out Php system without using a database, you need to follow the instruction below, its easy to perform and its easy to understand.

The first thing you need to know is you need to understand the basic function rule in Php and be sure to follow every instruction so that you can create your own Php system.


First download the wamp server and install it to your computer

1. The first thing you need to do is create a index.html by clicking text document






2. Open your text document and paste the code below and save the file as login.php, before you save the file make sure you select all files.

--------------------------------------------------------------------------------
<form id='login' action='page2.php' method='post' accept-charset='UTF-8'>
<fieldset >
<legend>Login</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<label for='username' >UserName*:</label>
<input type='text' name='username' id='username'  maxlength="50" />
<label for='password' >Password*:</label>
<input type='password' name='password' id='password' maxlength="50" />
<input type='submit' name='Submit' value='Submit' />
</fieldset>
</form>
--------------------------------------------------------------------------------







3. Create another text document and paste the code below and save the file as page2.php also choose select all file before saving the file like the one t the top.

--------------------------------------------------------------------------------
<?php
$username = $_POST['username'];
$password = $_POST['password'];

// my username is default as a CLINT and my password is HISOLER

if ($username =='CLINT' AND $password =='HISOLER'){
echo "SUCCESS";
}

else {
echo "You have not logged in";
}
?>

--------------------------------------------------------------------------------



4.  Once you have already save the two files, copy the two files and paste it on this location "My computer" "Local disk C"  "Wamp" "WWW" and create your folder name and paste the file inside the folder.






5. To test the system you created click the small icon of wamp server from the right corner of your screen and click Localhost




6. After you click the icon the browser will appear, then find your folder and test your system and your done,  or type localhost in your browser.




Dont forget to like our page for more tutorials.

Walang komento:

Mag-post ng isang Komento