Advertisement
Guest User

Untitled

a guest
May 26th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "progettotl";
  4. $password = "";
  5. $db = "my_progettotl";
  6. $user = $_POST['userl'];
  7. $pw = $_POST['passwordl'];
  8. // Create connection
  9. $conn = new mysqli($servername, $username, $password,$db);
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $sql = "SELECT nome FROM `login` where username = '$user' and password = '$pw'";
  16. $result = $conn->query($sql);
  17.  
  18. while($row = $result->fetch_assoc()) {
  19. $asdasd =$row["nome"];
  20. }
  21. if ($asdasd != "") {
  22. session_start();
  23. $_SESSION["asd"] = "$asdasd";
  24. header("Location: http://progettotl.altervista.org");
  25.  
  26. } else {
  27. echo "0 results";
  28. }
  29. $conn->close();
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement