-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
26 lines (25 loc) · 982 Bytes
/
signup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once('includes/recaptchalib.php');
require_once('includes/UserClass.php');
$privatekey = "6Lce-t0SAAAAAD3ar0uxPHqUlwwvOrT3NNLgoPUV";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
$auth = new Auth();
if(!$_POST['name']=='' OR !$_POST['email']=='' OR !$_POST['password']=='')
$result=$auth->createUser($_POST['name'],$_POST['email'],$_POST['password']);
if($result) {
header("Location: index.php?login=1");
echo "Thanks for signing up!";
}
else {
header("Location: index.php?signfail=1");
}
}
?>