- 精华
- 阅读权限
- 70
- 好友
- 相册
- 分享
- 听众
- 收听
- 注册时间
- 2015-10-7
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
发表于 2015-10-30 14:01:57
|
显示全部楼层
这个网站怎么才能连接到数据库 注册账号呢,关键是如何能注册账号 一点注册就弹出网页<?php
session_start();
include_once("./Config/Config.php");
if(!$isREG) die("未开放注册!");
if($_POST){
include_once("./Class/function_common.php");
$illegal=illegalsubmit();
$POST=Addslashess($_POST);
include_once("./Class/mysql_new_class.php");
$connobj=new mysql_class($SQLhost,$SQLuser,$SQLPWD,$DATABASE);
$sql="select name from account where name='$POST[login_name]'";
$accountid=$connobj->queryone($sql);
$realname ='$POST[login_name]';
if($accountid) die("<script>alert('已存在该用户名');history.back();</script>");
$pwd=md5($POST['login_password']);
$sql="INSERT INTO account (name,password,email,is_adult) VALUES ('$POST[login_name]','$pwd','$POST[email]','1')";
$id=$connobj->querysql($sql);
if($id)
{
$result =mysql_query("select id from account where name='$POST[login_name]'");
$newid=mysql_result($result, 0);
mysql_select_db("acc_db") or die(mysql_error());
mysql_query("set names 'GBK'");
mysql_query("INSERT INTO sx_vas_table (Account_ID,Server_Name,VAS_Point) VALUES ($newid,'一线','10000')");
die("<script>alert('注册成功!已免费赠送给您10000点券');top.location='/';</script>");
}else{
die("<script>alert('注册失败!');history.back();</script>");
}
}
?>
|
|