Hallo,
und zwar habe ich ein Script zu einer Registrierung, leider werden die eingetragenen Daten nicht in die Datenbank übertragen. Verbindung habe ich getestet und besteht. Dennoch; was passiert ist, ich drücke auf Registrieren, mir wird eine Erfolgsmeldung geschickt
(Registration successful, please check your emails to activate your account),
aber wenn ich dann in mysql nachsehe, dann sind keine neuen Daten angekommen.
Verzweifle schon......
Wäre super, wenn mich jemand erleuchten könnte
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="css/style.css"/>
</head>
<?php
include 'top.html'
?>
<div id="centre">
<?php
include 'connect_to_database.php';
if ($_POST['register'])
{
$firstname = addslashes(strip_tags($_POST['firstname']));
$lastname = addslashes(strip_tags($_POST['lastname']));
$password = addslashes(strip_tags($_POST['password']));
$email = addslashes(strip_tags($_POST['email']));
if (!$firstname||!$lastname||!$password||!$email)
echo "Please fill out all fields";
else
{
$password = md5($password);
$check = mysql_query("SELECT * FROM users WHERE email='$email'");
if (mysql_num_rows($check)>=1)
echo "Email is already taken";
else
{
$code = rand(11111111,99999999);
$to = $email;
$subject = "Activate your account";
$headers = "";
$body = "";
if (!mail($to,$subject,$body,$headers))
echo "Didn't work. Please try again.";
else
{
$register = mysql_query("INSERT INTO users VALUES ('','$firstname','$lastname','$password','$email','$code','0')");
echo "You have been registered successfully! Please check your email ($email) to activate your account";
}
}
}
}
else
{
?>
<form action='register.php' method='POST'>
Choose firstname:<br />
<input type='text' name='firstname'><p />
Choose lastname:<br />
<input type='text' name='lastname'><p />
Choose password:<br />
<input type='password' name='password'><p />
Email:<br />
<input type='text' name='email'><p />
<input type='submit' name='register' value='Register'>
</form>
<?php
}
?>
</div>
<?php
include 'bottom.html'
?>