Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET['id']) and isset($_GET['psw']) or isset($_COOKIE['id']) and isset($_COOKIE['psw'])) {
- echo"ciao";
- if (isset($_GET['id']) and isset($_GET['psw'])){
- $id=$_GET['id'];
- $psw=$_GET['psw'];}
- else{
- $id=$_COOKIE['id'];
- $psw=$_COOKIE['psw'];}
- }else{
- $id=$psw="";
- echo"
- <html>
- <h1 align='center'>Login</h1>
- <form action='login.php' method='GET'>
- inserisci nome utente:<input type='text' name='id'/>
- <br>
- inserisci la password<input type='password' name='psw'/>
- <input type='submit' value='Login'/>
- <br>
- </form>
- </html>
- ";
- }
- if($id=="prova" and $psw=="prova"){
- setcookie("id", $id, time()+5000);
- setcookie("psw", $psw, time()+5000);
- echo "<h5>Benvenuto</h5>".$id." ".$psw;
- echo"<form action='login.php' method='POST'>";
- echo"<input type='submit' name='Logout' value='Logout'/>";
- echo"</form>";
- }
- if(isset ($_POST['Logout']))
- {
- $id=$psw="";
- setcookie("id", $id, time()+0);
- setcookie("psw", $psw, time()+0);
- header("refresh:0;url=login.php");}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement