```php
<?php
session_start();
require_once('includes/config.php');
require_once('includes/functions.php');
if (isset($_POST['Submit'])) {
$email = clean($_POST['email']);
$email2 = clean($_POST['email2']);
$password = clean($_POST['password']);
$password2 = clean($_POST['password2']);
if ($email == "" || $email2 == "" || $password == "" || $password2 == "") {
$error .= 'Error';
} else {
if (strlen($password) < 6){
$error .= "Password";
}
if ($password != $password2) {
$error .= 'Password';
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error .= 'Incorrect Email';
} else {
$statement = $pdo->prepare('SELECT * FROM Accounts WHERE email = :email');
$statement->execute(array(':email' => $email));
$rows = $statement->fetch(PDO::FETCH_ASSOC);
if($rows) {
$error .= 'Incorrect Email!';
}
}
}
if (!isset($error)) {
$statement = $pdo->prepare('EXEC WZ_ACCOUNT_CREATE :ip, :email, assword, 0, 0, 0,');
$params = array( ':ip' => $ip, ':email' => $email, 'assword' => $password );
if ($statement->execute($params)) {
echo 'Error!';
}
} else {
echo $error;
}
}
?>
Register / Sign Up
Register Kay?t
<?php
$server = "ss";
$username = "ss";
$password = "ss";
$database = "ss";
$ip = $_SERVER['REMOTE_ADDR'];
try {
$pdo = new PDO("sqlsrv:Server=".$server.";Database=".$database."", $username, $password);
} catch (PDOException $e) {
echo $e->getMessage();
}
?>
I am trying to save data to the database but it's not saving, what could be the reason?
```
<?php
session_start();
require_once('includes/config.php');
require_once('includes/functions.php');
if (isset($_POST['Submit'])) {
$email = clean($_POST['email']);
$email2 = clean($_POST['email2']);
$password = clean($_POST['password']);
$password2 = clean($_POST['password2']);
if ($email == "" || $email2 == "" || $password == "" || $password2 == "") {
$error .= 'Error';
} else {
if (strlen($password) < 6){
$error .= "Password";
}
if ($password != $password2) {
$error .= 'Password';
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error .= 'Incorrect Email';
} else {
$statement = $pdo->prepare('SELECT * FROM Accounts WHERE email = :email');
$statement->execute(array(':email' => $email));
$rows = $statement->fetch(PDO::FETCH_ASSOC);
if($rows) {
$error .= 'Incorrect Email!';
}
}
}
if (!isset($error)) {
$statement = $pdo->prepare('EXEC WZ_ACCOUNT_CREATE :ip, :email, assword, 0, 0, 0,');
$params = array( ':ip' => $ip, ':email' => $email, 'assword' => $password );
if ($statement->execute($params)) {
echo 'Error!';
}
} else {
echo $error;
}
}
?>
Register / Sign Up
Register Kay?t
<?php
$server = "ss";
$username = "ss";
$password = "ss";
$database = "ss";
$ip = $_SERVER['REMOTE_ADDR'];
try {
$pdo = new PDO("sqlsrv:Server=".$server.";Database=".$database."", $username, $password);
} catch (PDOException $e) {
echo $e->getMessage();
}
?>
I am trying to save data to the database but it's not saving, what could be the reason?
```