-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_email.php(08-02-2014)
86 lines (53 loc) · 3.04 KB
/
check_email.php(08-02-2014)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
author: istockphp.com
*/
require_once("connection.php"); // require the db connection
/* catch the post data from ajax */
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$telephone_number=$_POST['telephone_number'];
$email = $_POST['email'];
$password=md5($_POST['password']);
$newsletter =$_POST['newsletter'];
$status='0';
$u=uniqid();
$cDate=date("Y-m-d");
session_start();
$_SESSION['email']=$email;
$query = mysql_query("SELECT `email` FROM `registration` WHERE `email` = '$email'");
if(mysql_num_rows($query) == 1) { // if return 1, email exist.
echo '1';
} if(mysql_num_rows($query) == 0) { // if return 1, email exist.
/*$query = mysql_query("INSERT INTO `registration` (`first_name` ,`last_name`,`telephone_number` ,`email`,`password`,`newsletter`,`status`,`date`)
VALUES ('$first_name', '$last_name',`$telephone_number`, '$email',`password`,`$newsletter`,`$status`,`$cDate`)");*/
$insert="INSERT INTO registration(first_name,last_name,phone,email,password,newsletter,status,date)VALUES('".$first_name."','".$last_name."','".$telephone_number."','".$email."','".$password."','".$newsletter."','".$status."','".$cDate."')";
$run=mysql_query($insert);
$u=uniqid();
$to = $_POST['email'];
$subject = 'Please active your new Elaxy account';
//$headers = "From: ".$admininfo['email']." \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message.= '<html><body>';
$message.='<table width="100%" border="0">';
$message.='<tr><td align="center"><h2>Welcome</h2></td></tr>';
$message.='<tr><td><img src="http://gravityweb.net/elaxy/images/logo.png"></td></tr>';
$message.='<tr><td height="57"><strong> Hi '. $first_name.",".'</strong></td></tr>';
$message.='<tr><td height="48">Thanks for creating a Elaxy account. In order to activate your account, please click on the link below so that we can be sure that this email address belongs to you:</td></tr>';
$message.='<tr><td height="54"><a href="http://gravityweb.net/elaxy/activate-user.php?id='.$to.'&key='.$u.'">Activate your account</a></td>
</tr>';
$message.='<tr>
<td height="82">If the link does not work for some reason you can also confirm your email address by copying and pasting the following link into your web browser address bar:</td>
</tr>';
$message.='<tr><td height="73"><a href="http://gravityweb.net/elaxy/activate-user.php?id='.$to.'&key='.$u.'">http://gravityweb.net/elaxy/activate-user.php?id='.$to.'&key='.$u.'</a></td></tr>';
$message.='<tr><td>Thanks</td></tr>';
$message.='<tr><td height="72">Elaxy Team</td></tr>';
$message.='<tr>
<td height="72">P.S. If you no longer want a Elaxy account or if you believe that this message was sent by mistake, please ignore this email. We will leave you alone and not trouble you again!</td>
</tr>';
$message.='</table>';
$message .= "</body></html>";
$mail_sent=mail($to, $subject, $message, $headers);
}
?>