<?php function load_template($name) { include $_SERVER['DOCUMENT_ROOT'] . "/photogram-project-php/_templates/$name.php"; } // Function to validate the credentials. function validate_credentials($username, $password) { if ($username == "raghav@gmail.com" and $password == "raghav") { return true; } else { return false; } } // Connecting to database function signup($user, $pass, $email, $phone) { $servername = "mysql.selfmade.ninja"; $username = "raghav"; $password = "R1a2g1h3av"; $dbname = "raghav_photogram"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "INSERT INTO `auth` (`username`, `password`, `email`, `phone`, `block`, `active`) VALUES ('$user', '$pass', '$email', '$phone', '0', '1');"; $result = false; if ($conn->query($sql) === TRUE) { $result = true; } else { echo "Error: " . $sql . "<br>" . $conn->error; $result = false; } $conn->close(); return $result; }