📄 add_users.php
字号:
<?php
include('lib/conf.php');
require_once 'lib/Session.php';
include('lib/function.php');
$name = $_POST["name"];
$surname = $_POST["surname"];
$user_name = $_POST["user_name"];
$email = $_POST["email"];
$pass = $_POST["pass"];
$pass1 = $_POST["pass1"];
$number = $_POST['txtNumber'];
//session_start();
if (md5($number) != $_SESSION['image_random_value']) {
echo "The Number Verification is not valid! Try again...<br>";
echo "<a href=\"javascript:history.back();\">Go back</a>";
exit();
}
// validate email
if(!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
echo "The email is not valid! Try again...<br>";
echo "<a href=\"javascript:history.back();\">Go back</a>";
exit();
}
if (($pass == "") || ($pass != $pass1)) {
echo "The password are different or null! Try again...";
echo "<a href=\"javascript:history.back();\">Go back</a>";
exit();
}
$hash=md5($email.$hidden_hash_var);
$conn = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname,$conn);
$now = date("YmdHis");
$query = "INSERT INTO `USERS` (`id`, `hash`, `pass`, `email`, `user_name`, `name`, `surname`, `status`) VALUES ('', '$hash', MD5('$pass'), '$email', '$user_name', '$name', '$surname', '$now');";
mysql_query($query)
or die("<br>Invalid query: $query\n<BR>\n" . mysql_error());
//mysql_close($conn);
$message = "Thank You For Registering at VPN COMMUNITY!".
"\nSimply follow this link to confirm your registration: ".
"\n\nhttp://ovpnwc.sourceforge.net/user_confirm.php?hash=$hash&email=". urlencode($email).
"\n\nIf you make your registration AFTER got a membership confirm is important that you follow again the link of the previus email, because YOU ARE STILL UNCORFIRMED from that VPN!".
"\n\nOnce you confirm, you can use the services on VPN COMMUNITY.";
$query = "INSERT INTO email VALUES (null, '$email', 'Confirm your registration to VPN Community', '$message');";
mysql_query($query)
or die("<br>Invalid query: $query\n<BR>\n" . mysql_error());
echo "A Email will be sent to $email in a minute!";
redirect("index.php?pag=myaccount", 5);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -