chk.php <?php
$yer=$_GET['yer'];
$mon=$_GET['mon'];
$day=$_GET['day'];
$link=@mysql_connect("localhost","root","root") or die ("数据库链接失败".mysql_error());
mysql_select_db("bnk",$link);
mysql_query("set names gb2312");
$sql=mysql_query("select * from bnk_stm where YER='".$yer. "' and MON='".$mon. "'and DAY='".$day."' and RAT_S=1 order by rand() limit 1");
$row=mysql_fetch_array($sql);
if($row==false) {
echo "跳转到没有资料的页面";
}
else{
echo "跳转到有资料的页面";
?> <?php
}
mysql_close($link);
?>上面的代码 判断值为空或不空时如何做JS跳转?就是check过后直接跳转到另一个页面
$yer=$_GET['yer'];
$mon=$_GET['mon'];
$day=$_GET['day'];
$link=@mysql_connect("localhost","root","root") or die ("数据库链接失败".mysql_error());
mysql_select_db("bnk",$link);
mysql_query("set names gb2312");
$sql=mysql_query("select * from bnk_stm where YER='".$yer. "' and MON='".$mon. "'and DAY='".$day."' and RAT_S=1 order by rand() limit 1");
$row=mysql_fetch_array($sql);
if($row==false) {
echo "跳转到没有资料的页面";
}
else{
echo "跳转到有资料的页面";
?> <?php
}
mysql_close($link);
?>上面的代码 判断值为空或不空时如何做JS跳转?就是check过后直接跳转到另一个页面
echo '<script>document.location.href="php.php";</script>'
}
else{
echo '<script>document.location.href="php.php";</script>'
}
'<script language="javascript"type="text/javascript">
window.location.href="../STAMP_CENTER/index.php?STAMP=$row[STAMP]</script>';地址后我想让STAMP等于这个字段的值,应该怎样用引号?
echo "<script language=\"javascript\"type=\"text/javascript\">
window.location.href=\"../STAMP_CENTER/index.php?STAMP=".$row[STAMP]."</script>";
echo '<script language="javascript"type="text/javascript">
window.location.href="../STAMP_CENTER/index.php?STAMP='.$row['STAMP'].'</script>';
function alert_go($msg,$url){
echo('<script language="JavaScript">');
//echo("alert('$msg');");
echo("location.href='$url';");
echo('</script>');
exit;
}
alert_go($url);
function alert_go($msg,$url){
echo('<script language="JavaScript">');
echo("alert('$msg');");
echo("location.href='$url';");
echo('</script>');
exit;
}
alert_go('记录不能为空',$url);//提示后自动跳转到指定的页面去