Advertisement
Guest User

ciancio bastianazzo il dog

a guest
Jan 29th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php
  2. if (isset($_GET['id']) and isset($_GET['psw']) or isset($_COOKIE['id']) and isset($_COOKIE['psw'])) {
  3. echo"ciao";
  4. if (isset($_GET['id']) and isset($_GET['psw'])){
  5. $id=$_GET['id'];
  6. $psw=$_GET['psw'];}
  7. else{
  8. $id=$_COOKIE['id'];
  9. $psw=$_COOKIE['psw'];}
  10. }else{
  11. $id=$psw="";
  12. echo"
  13. <html>
  14. <h1 align='center'>Login</h1>
  15. <form action='login.php' method='GET'>
  16. inserisci nome utente:<input type='text' name='id'/>
  17. <br>
  18. inserisci la password<input type='password' name='psw'/>
  19. <input type='submit' value='Login'/>
  20. <br>
  21. </form>
  22. </html>
  23. ";
  24.  
  25. }
  26.  
  27. if($id=="prova" and $psw=="prova"){
  28. setcookie("id", $id, time()+5000);
  29. setcookie("psw", $psw, time()+5000);
  30. echo "<h5>Benvenuto</h5>".$id." ".$psw;
  31. echo"<form action='login.php' method='POST'>";
  32. echo"<input type='submit' name='Logout' value='Logout'/>";
  33. echo"</form>";
  34.  
  35. }
  36. if(isset ($_POST['Logout']))
  37. {
  38. $id=$psw="";
  39. setcookie("id", $id, time()+0);
  40. setcookie("psw", $psw, time()+0);
  41. header("refresh:0;url=login.php");}
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement