Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "progettotl";
- $password = "";
- $db = "my_progettotl";
- $user = $_POST['userl'];
- $pw = $_POST['passwordl'];
- // Create connection
- $conn = new mysqli($servername, $username, $password,$db);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT nome FROM `login` where username = '$user' and password = '$pw'";
- $result = $conn->query($sql);
- while($row = $result->fetch_assoc()) {
- $asdasd =$row["nome"];
- }
- if ($asdasd != "") {
- session_start();
- $_SESSION["asd"] = "$asdasd";
- header("Location: http://progettotl.altervista.org");
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement