Hello,
try out this:
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if(($_POST['username'] == 'Arjita') && (md5($_POST['password']) == 'd524813536b71639999ba12bdb3621a8')){
echo "Welcome Arjita";
}else{
echo "You are not authorized to view this");
}
?>
<form action="./Login.php" method="post">
Username: <input type="text" name="username">
Password: <input type="password" name="password">
<input type="submit" value="Login">
</form>
</body>
</html>
Normally you would not give out the formular any more if login is suceed, but for your test this is not neccessary.
For further Information please also refer to the PHP-Manual located here:
http://www.php.net/manual/en/
To prevent your potentially next question: Save the File in C:\xampp\htdocs\ as Login.php (exactly in this notation!). Then open your Browser and load
http://localhost/Login.php Your Site should be loaded (if you startet the Apache Webserver).
glitzi