这是一个自定义的函数:很好用
<?
//$URL 要跳转的连接
//$title 标题
//$content 描述
function jump_page($URL,$title,$content)
{
print <<<EOT <html> <head> <style type="text/css"> <!-- a {color:#333333;font-size: 9pt;text-decoration:none; } a:hover {color:#000066;text-decoration:underline overline;} td{FONT-SIZE: 9pt; color:#333333; font-family:宋体} --> </style> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta HTTP-EQUIV=REFRESH CONTENT='5; URL=$URL'> <script language="Javascript"> function Show(divid) { divid.filters.revealTrans.apply(); divid.style.visibility = "visible"; divid.filters.revealTrans.play(); } function Hide(divid) { divid.filters.revealTrans.apply(); divid.style.visibility = "hidden"; divid.filters.revealTrans.play(); } </script> </head> <body bgcolor="#e3e6e3" Onload="Show(msgboard)"> <div id="msgboard" style="FILTER: revealTrans(transition=23,duration=0.5) blendTrans(duration=0.5); position:absolute; left:300px; top:200px; width:300px; height:100px; z-index:1; visibility: hidden"> <table width="80%" border=0 cellspacing=0 cellpadding=6 bgcolor="#eeeeee" align=center> <tr> <td><b>$content</b></td> </tr> </table> </div> <script> setTimeout('Hide(msgboard)',3000); </script> </body> </html>EOT;exit;}jump_page('index.php','成功登录','<br>状态:用户成功登录!<br><ul><li><a href="index.php">返回首页</a></li></ul>');//这是用法
?>
<?
//$URL 要跳转的连接
//$title 标题
//$content 描述
function jump_page($URL,$title,$content)
{
print <<<EOT <html> <head> <style type="text/css"> <!-- a {color:#333333;font-size: 9pt;text-decoration:none; } a:hover {color:#000066;text-decoration:underline overline;} td{FONT-SIZE: 9pt; color:#333333; font-family:宋体} --> </style> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta HTTP-EQUIV=REFRESH CONTENT='5; URL=$URL'> <script language="Javascript"> function Show(divid) { divid.filters.revealTrans.apply(); divid.style.visibility = "visible"; divid.filters.revealTrans.play(); } function Hide(divid) { divid.filters.revealTrans.apply(); divid.style.visibility = "hidden"; divid.filters.revealTrans.play(); } </script> </head> <body bgcolor="#e3e6e3" Onload="Show(msgboard)"> <div id="msgboard" style="FILTER: revealTrans(transition=23,duration=0.5) blendTrans(duration=0.5); position:absolute; left:300px; top:200px; width:300px; height:100px; z-index:1; visibility: hidden"> <table width="80%" border=0 cellspacing=0 cellpadding=6 bgcolor="#eeeeee" align=center> <tr> <td><b>$content</b></td> </tr> </table> </div> <script> setTimeout('Hide(msgboard)',3000); </script> </body> </html>EOT;exit;}jump_page('index.php','成功登录','<br>状态:用户成功登录!<br><ul><li><a href="index.php">返回首页</a></li></ul>');//这是用法
?>
解决方案 »
- 求解啊……
- 高分求ftp_get函数下载文件乱码问题
- Your browser (or proxy) sent a request that this server could not understand在线等急
- 请问带宽2M的服务器对网站有哪些影响?
- 大神,求解访问qq日志的访问者的qq号码,好像之前的代码没法用了
- 菜鸟求一段PHP代码,先谢谢了!
- 急,连接数据库出错!
- php+sqlserver遇到一个表单提交的怪问题
- 谁用过vb论坛,谁又遇到过这个问题?
- 自定义一个函数,可以达到array_reverse这个函数的效果,将一个一维数组顺序颠倒
- 调查:用PHP做的有名网站有哪些
- 编号自动生成问题
可能是我表述的不太清楚,我是想不使用html标志和js,向知道php中有没有直接可以随时跳转的函数
this.location.href = "test.php";
</script>
用header就可以实现即时跳转。
不过在开始用
ob_start()最后用
end_flush();
标准php用法
this.location.href = "test.php";
</script>
他们绕来绕去的不正面回答你的问题,还是我来直接回答吧.
学PHP是不能完全避开js的,虽然你可以决定掺入js的多少.
什么叫绕来绕去?
asp里的重定向也是通过发送header来实现的,
不过asp是默认打开输出缓存而已,所以可以实现即时跳转。
php里,如果php.ini里设定了output_buffering = On
再使用header("Location: sss.php");
效果跟response.redirect 一样。cgi的标准就那样。
这是标准php用法你试试/