Download login.php from Pezh/pde: direct link, hf CLI and curl.
- Browser
- Download file 753 Bytes
-
https://huggingface.co/spaces/Pezh/pde/resolve/main/login.php
- Command line
-
hf download hf://spaces/Pezh/pde/login.php
-
curl -L -o login.php https://huggingface.co/spaces/Pezh/pde/resolve/main/login.php
753 Bytes
| // Database connection | |
| $servername = "localhost"; | |
| $username = "your_username"; | |
| $password = "your_password"; | |
| $dbname = "your_database"; | |
| $conn = new mysqli($servername, $username, $password, $dbname); | |
| if ($conn->connect_error) { | |
| die("Connection failed: " . $conn->connect_error); | |
| } | |
| // Retrieve user credentials from POST request | |
| $username = $_POST['username']; | |
| $password = $_POST['password']; | |
| // Check if the user exists in the database | |
| $sql = "SELECT * FROM users WHERE username='$username' AND password='$password'"; | |
| $result = $conn->query($sql); | |
| if ($result->num_rows > 0) { | |
| echo "Login successful!"; | |
| // Redirect to the video page | |
| header("Location: videos.php"); | |
| } else { | |
| echo "Invalid username or password."; | |
| } | |
| $conn->close(); | |