Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function setc($name, $content, $hours = "24") {
- setcookie($name,$content,time()+3600*$hours);
- }
- function read_cookie($username){
- return $_COOKIE[$username];
- }
- ?>
- <!doctype html>
- <html>
- <head>
- <title>WebTrix- Log In</title>
- <link rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="main">
- <div id="header">
- <div id="MyForm">
- <br /><h1>WebMatrix</h1>
- <form action="login.php" method="post">
- <?php
- if(isset($_POST["username"]))
- {
- $username=$_POST["username"];
- $MyPass=$_POST["MyPass"];
- if($username=="Admin"&&$MyPass==123456) {
- setc("username", $username, 48);
- setc("password", $MyPass, 48);
- print <<<HTML
- Welcom Admin
- <br /><br /><br /><br />
- <a href='secret.php' id='secret'>Secret page</a>
- HTML;
- }
- }
- else
- {
- echo "The username or Password you enterd is not correct!";
- echo "<br />";
- echo "<br />";
- echo "<br />";
- echo "<br />";
- echo "<a href='index.html'>Try again</a>";
- }
- }
- ?>
- </form>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement