Witam,
Chciałbym w tym skrypcie na rejestrację, dodać opcje sprawdzania, czy dany e-mail jest już zajęty, jednak jestem w tym zielony.. Proszę o pomoc.
public function add()
{
$this->login = $_POST['login'];
$this->password = md5($_POST['password']); $this->mail = $_POST['mail'];
$this->ref = $_POST['ref'];
}
public function check()
{
include ("language/pl.php");
if (!empty($_POST['spr'])) {
if ((!empty($_POST['login'])) && (!empty($_POST['password'])) && (!empty($_POST['mail']))) {
if ($_POST['password'] == $_POST['vpassword'])
{
$this->spr = $this->pdo->prepare("SELECT * FROM platnosci WHERE login=?");
$this->spr->execute(array($this->login)); $this->spr1 = $this->spr->fetchColumn();
if ($this->spr1 == 0)
{
$this->insert = $this->pdo->exec('INSERT INTO `platnosci` (`login`, `password`, `points`, `ref`, `mail`) VALUES(
\'' . $this->login . '\',
\'' . $this->password . '\',
\'0 \',
\'' . $this->ref . '\',
\'' . $this->mail . '\')');
if ($this->insert > 0)
{
$this->stmt = $lang[0];
} else
{
$this->stmt = $lang[1];
}
} else
{
$this->stmt = $lang[6];
}
} else
{
$this->stmt = $lang[3];
}
} else
{
$this->stmt = $lang[2];
}
}
return $this->stmt;
}