登录代码示例(php) html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
word='$user_password'"; $result=mysql_query($select,$conn); $row=mysql_num_rows($result); if($row==1){ $_SESSION["admin"]="yes"; $_SESSION["id"]="$user_name"; echo""; echo"
"; }else{ echo"
"; } ?>
注册代码 alert('用户名已被
注册!');history.go(-1);"); exit(); }
1
$_SESSION[username]=$_POST[txt_regname]; $regname=$_POST[txt_regname]; $regrealname=$_POST[txt_regrealname]; $regpwd=$_POST[txt_regpwd]; $regbirthday=$_POST[txt_birthday]; $regemail=$_POST[txt_regemail]; $regcity=$_POST[txt_province].$_POST[txt_city]; $regico=$_POST[txt_ico]; $regsex=$_POST[txt_regsex]; $regqq=$_POST[txt_regqq]; $reghomepage=$_POST[txt_reghomepage]; $regsign=$_POST[txt_regsign]; $regintroduce=$_POST[txt_regintroduce]; $ip=getenv(REMOTE_ADDR); $INS=mysql_query("Insert Into tb_user
(regname,regrealname,regpwd,regbirthday,regemail,regcity,regico,regsex,regqq,reghomepage,regsign,regintroduce ,ip,fig) Values
('$regname','$regrealname','$regpwd','$regbirthday','$regemail','$regcity','$regico','$regsex','$regqq','$reghomepage ','$regsign','$regintroduce','$ip',0)"); echo "
"; echo "
"; ?> 删除代码示例 html PUBLIC "-//W3C//DTD X
HTML 1.0 Transitional//EN"
"w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
$conn=my
sql_connect("localhost","root","721wyzj") or die ("数据库服务器连接失败!".
mysql_error()); mysql_select_db("soft",$conn) or die ("数据库连接失败!".mysql_error()); mysql_query("set names gb2312;"); $sql="delete from tb_article where title='$title'"; $result=mysql_query($sql,$conn); if($result) { echo("
"); echo("
");
2
}else{ echo("
");
}?> 数据库连接代码 相关 JS //
JavaScript Document //首页登录验证 function f_check(form){ if(form.txt_user.value==""){ alert("请输入用户名");form.txt_user.focus();return false; } if(form.txt_pwd.value==""){ alert("请输入密码");form.txt_pwd.focus();return false; }