Topic: {Need Help} Registration Page.
Righty so from wee while im trying to make this one to work could any one have a look and say wtf im doing wrong here ?
Im trying to force website to send data to my DB but still getting error with configuration on line 18.
<?php
include('../config/dbconf.php');
function encrypt($user, $pass) {
$user = strtoupper($user);
$pass = strtoupper($pass);
return sha1($user.':'.$pass);
}
$username = $_POST['user'];
$password = encrypt($username, $_POST['pass']);
$email = $_POST['email'];
$count = 0;
THIS IS THE ERROR ROW
$stmt = $conn->prepare("SELECT uid FROM BNET WHERE user=:acct_username OR email=:acct_email LIMIT 0,1");
THIS IS THE ERROR ROW
$stmt->bind_param("s", $username);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows > 0) {
$count = 1;
}
if($count == 0) {
$sql = "INSERT INTO BNET (acct_username,acct_passhash1,acct_email) VALUES(?, ?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("sssi",$username, $password, $email);
if($stmt->execute()) {
echo "registered";
}else{
echo "Failed to register<br>" . $stmt->error;
}
}else{
echo "1";
}
?>