Jump to content

Striapper

New Members
  • Posts

    1
  • Joined

  • Last visited

Striapper's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi guys, i'm having trouble with my register page. I don't get any error but when I try to register i get a blank page and just cant figure out where i have gone wrong any help would be would be great Thanks in advance. <?php include "functions.php"; connect(); if(isset($_POST['register'])) { $username = protect($_POST['username']); $password = protect($_POST['password']); $email = protect($_POST['email']); if(strlen($username) > 20) { echo "Username must be less than 20 characters!"; }elseif(strlen($email) > 100) { echo "Email must be less than 100 characters!"; }else{ $stmt = $mysqli->prepare("SELECT username FROM user WHERE username = ? LIMIT 1"); $stmt->bind_param("s", $username); $stmt->execute(); $result = $stmt->get_result(); if($result->num_rows == 1) { echo "Username already taken!"; }else{ $sql = "INSERT INTO user (username, password, email) VALUES(?,?,?)"; $stmt = $db->prepare($sql); $stmt->bind_param("sss", $username, $password, $email); $stmt->execute(); echo "Sucsessfully registered"; $mysqli -> close(); } } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.