Holas,
Evita a que te den codigo o todo el codigo que deseas, es muy mala costumbre a mi opinon, pero vale, aqui te lo paso:
Código PHP:
Ver original<?php
header("Content-Type: text/xml;charset=UTF-8");
include('header.php');
$errors = "";
$username = $_POST['username'];
$password = $_POST['password'];
$password2 = $_POST['password2'];
$email = $_POST['email'];
$ip = $_SERVER['REMOTE_ADDR'];
$errors .= 'Please enter something in all of the fields.<br/>';
}
$errors .= 'Please keep your username between 3 and 20 letters.<br/>';
}
if ($password != $password2){
$errors .= 'The passwords you entered do not match.<br/>';
}
if (!preg_match("/^[a-z][a-z0-9_.-]+@[a-z0-9][a-z0-9-]+\.[a-z]+(\.[a-z]+)*$/i", $email)){ $errors .= 'The e-mail address you entered is not valid.<br/>';
}
$errors .= 'Please keep your e-mail address lower than 40 letters.<br/>';
}
$check_username = mysql_query("SELECT `id` FROM `users` WHERE `username`='$username'"); $check_email = mysql_query("SELECT `id` FROM `users` WHERE `email`='$email'");
$errors .= 'That username is already taken by another user.<br/>';
}
$errors .= 'We only allow one account per user.<br />';
} else {
if($errors == "") {
mysql_query("INSERT INTO `users` (`username`,`password`,`email`,`ip`,`reg_date`) VALUES ('$username', '$password', '$email', '$ip', '" . date('Y-m-d H:i:s',time()) . "')"); }
}
if($errors != "") {
$maincontent = $errors;
} else {
$maincontent = "<strong>You have registered successfully!</strong> You may now log in.";
}
$publickey = "6LeC9dISAAAAALgCYFVWW8ZLPIw6WGN34BGf5COQ";
?>
<code><?php
/* Donne
Array
(
[username] => khalid
[password] => khalidpwd
[password2] => khalidpwd
[recaptcha_challenge_field] => 02J5iH75gdOFfyKNrvFr-Hz9MPxo4nrpoRWu_x-wP6v0oPK8rLZzMvd5cPtKpMcu8
jZcMJxryo3TNW9bTtHghAu5PAwYtbJQQovzPM8t3GMOmih2Qan3iD8Mdou_pwDgj2H8B9sl8FI-MFJUPEHZeG3RvYodxGw1uPxh3
yls9H4qOrYgg8lnuOB5mm4mO9L03vrB3FQLMmlxorK29RAm2aIWQ7rXLZMeZ0LFR-_QngSNQwRuj3m0NCUpGUXOXjHiDoUsfzQ0K
6a7K7UMq3jqakkC9-MlUB
[recaptcha_response_field] => peron smock
[PHPSESSID] => e5ackrv75hsi4kagssgi33ehm5
)
*/
if($errors != "") {
$result = "Errors occured:<br/>" . $errors;
} else {
$result = "Ok";
}
echo $result;
?></code>
Vamos dale un poco de esfuerzo y asi le aprendes mejor.
Saludos