Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'DB_info.php';
- require_once 'UTILS.php';
- $alienname = $_POST['alienname'];
- $email =$_POST['email'];
- $uUsername =$_POST['ausername'];
- $upassword =$_POST['apassword'];
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT alienname FROM $myAliens WHERE alienname='$alienname'";
- $result = $conn->query($sql);
- checkErrorReturn
- ($result->num_rows > 0,
- "An alien with this name is already registered!",
- "Back to registration page",
- "register.html");
- $sql ="INSERT INTO `myaliendb`.`myaliens` (`alienname`, `Email`, `Username`, `Password`) VALUES ('$alienname', '$email', '$uUsername', '$upassword')";
- if ($conn->query($sql) === TRUE) {
- echo "New user has been created.";
- echo " Back to <a href= 'index.html'>login<a>";
- } else {
- echo "error";
- }
- $conn->close();
- $thisAlienDir = $alienPicturesDir . "/" . $alienname;
- checkErrorReturn
- (! mkdir($thisAlienDir,0700),
- "Could not create directory $thisAlienDir.",
- "Back to registration page",
- "register.html");
- echo "<h1> Welcome $alienname! You were successfully
- registered! </h1>";
- echo '<h1> <a href="index.html"> Go to the signin page </a> </h1>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement