📄 do_adduser.php
字号:
<?
//check for required fields
if ((!$_POST[f_name]) || (!$_POST[l_name]) || (!$_POST[username])
|| (!$_POST[password]) || (!$_POST[repassword]) || (!$_POST[email])) {
header( "Location: http://82.39.116.47/reg/add.html");
exit;
}
//set up the names of the database and table
$db_name = "users";
$table_name = "auth_users";
//connect to the server and select the database
$connection = @mysql_connect("localhost", "jackie", "123456")
or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or
die(mysql_error());
//check is the username used by another member.
$query = "Select * from $table_name Where username='$_POST[username]'";
$blah = mysql_query($query);
$row = mysql_fetch_array($blah);
if ($row["username"] == $_POST[username])
{
header( "Location: http://82.39.116.47/reg/err_user.html");
exit;
}
if ( $_POST[password] != $_POST[repassword])
{
header ( "Location: http://82.39.116.47/reg/err_pass.html");
exit;
}
//create and issue query
$sql = "INSERT INTO $table_name (f_name, l_name, username,
password, email, gallery_name) VALUES ('$_POST[f_name]', '$_POST[l_name]', '$_POST[username]',
password('$_POST[password]'), '$_POST[email]', '$_POST[gallery_name]')";
$result = @mysql_query($sql,$connection) or die(mysql_error());
mkdir ("$_POST[username]", 0777);
?>
<HTML>
<HEAD>
<TITLE>Add a User</TITLE>
</HEAD>
<body bgcolor="#ccccff" link="#0000ff" vlink="#0000ff" alink="#0033ff">
<H1>Your Register<br> successful:</H1>
<P><STRONG>First Name:</STRONG><BR>
<? echo "$_POST[f_name]"; ?></p>
<P><STRONG>Last Name:</STRONG><BR>
<? echo "$_POST[l_name]"; ?></p>
<P><STRONG>Username:</STRONG><BR>
<? echo "$_POST[username]"; ?></p>
<P><STRONG>Password:</STRONG><BR>
<? echo "$_POST[password]"; ?></p>
<P><STRONG>E-mail:</STRONG><BR>
<? echo "$_POST[email]"; ?></p>
<P><STRONG>Gallery Name:</STRONG><BR>
<? echo "$_POST[gallery_name]"; ?></p>
<P><a href="index.php">Log In Now</a></p>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -