=''vbscript:history.back()'';</SCRIPT>";
}
if ($qq!="") {
if (!is_numeric($qq)) {
echo "<SCRIPT language=JavaScript>alert(''QQ号码必须是数字'');";
echo"this.location.href=''
vbscript:history.back()'';</SCRIPT>";
}
}
if ($youbian=="" or strlen($youbian)!=6) {
echo "<SCRIPT language=JavaScript>alert(''请正确输入邮编'');";
echo"this.location.href=''
vbscript:history.back()'';</SCRIPT>";
}
if ($youbian!="") {
if (!is_numeric($youbian)) {
echo "<SCRIPT language=JavaScript>alert(''邮编必须是数字'');";
echo"this.location.href=''
vbscript:history.back()'';</SCRIPT>";
}
}
if ($dizhi="") {
echo "<SCRIPT language=JavaScript>alert(''住址不能为空'');";
echo"this.location.href=''
vbscript:history.back()'';</SCRIPT>";
}
if ($mail=="") {
echo "<SCRIPT language=JavaScript>alert(''E-mail不能为空!'');";
echo "this.location.href=''vbscript:history.back()'';</SCRIPT>";
}
if ($textarea=="") {
echo "<SCRIPT language=JavaScript>alert(''个人说明不能为空!'');";
echo "this.location.href=''vbscript:history.back()'';</SCRIPT>";
}
if ($textarea=="" or strlen(textarea)>150) {
echo "<SCRIPT language=JavaScript>alert(''个人说明为150个字符'');";
echo"this.location.href=''
vbscript:history.back()'';</SCRIPT>";
}
24、对输出的内容进行判断,从而输出其它结果
<?php
if ($rs["active"]==1) {
echo "<font color=''#ff0000''>激活</font>";
}else{
echo "禁用";
}
?>
25.字符截取函数
<?=substr("$rs[zixun_biaoti]",0,28)?>
26.男女问题或单选带选择的
<input type="radio" name="hy_zhuangtai" value="男" <?php if ($rs["hy_zhungtai"]==="男") { echo "checked";}?>>男
<input type="radio" name="hy_zhuangtai" value="女" <?php if ($rs["hy_zhuangtai"]==="女") { echo "checked";}?>>女
27.单选不带单选框的
<?php if ($rs[''hy_zhuangtai'']==''锁定''){?>
<a href="Userzt.php?action=yes&id=<?php echo $rs[''hy_id''];?>">锁定</a>
<?php }
else{?>
<a href="Userzt.php?id=<?php echo $rs[''hy_id''];?>&action=no">解锁</a>
<?php }?>
它的 save页是
<?php require_once(''http://www.cnblogs.com/conn.php''); ?>
<?php
$hy_id=
PHP常用代码大全(新手入门必备)_网学
浏览:
GET[''id''];
$action=
PHP常用代码大全(新手入门必备)_网学
浏览:
GET[''action''];
if ($action==''yes''){
$sql="update hybiao set hy_zhuangtai=''锁定'' where hy_id=''$id''";
$query=mysql_query($sql,$connec);
echo("<script type=''text/javascript''>location.href=''UserManage.php'';</script>");
}
else{
$sql="update hybiao set hy_zhuangtai=''正常'' where hy_id=''$id''";
$query=mysql_query($sql,$connec);
echo("<script type=''text/javascript''>location.href=''UserManage.php'';</script>");
}
mysql_close();
?>
28. 如果文字过长,则将过长的部分变成省略号显示
<DIV STYLE="width: 120px; height: 50px; border: 0px solid blue;overflow: hidden; text-overflow:ellipsis">
<NOBR> 就是比如有一行文字,很长,表格内一行显示不下.</NOBR>
</DIV>
29.
禁止复制,鼠标拖动选取
<body ondragstart=window.event.returnValue=false oncontextmenu=w