首页 > php开发 > PHP重定向和页面快速转向

PHP重定向和页面快速转向

页面快速转向

<?php
function turntopage($url = "index.php", $info = "页面转向中...", $second = 2) {
    print "<html>n<head>n<title>页面转向中....</title>n";
    print "<meta http-equiv=\"refresh\" content=\"$second;url=$url\">\n"; //开源代码phprm.com
    print "<style type=\"text/css\">\n<!--n";
    print "td { font-family: \"verdana\", \"arial\";font-size: 12px}\n";
    print "a {color: #000000; text-decoration: none}\n";
    print "-->n</style>\n";
    print "</head>n<body>\n";
    print "<table width=\"100%\" border=\"0\" align=\"center\">\n";
    print " <tr>\n";
    print " <td height=\"200\"> </td>\n";
    print " </tr>\n";
    print " <tr>\n";
    print " <td align=\"center\">\n";
    print " <table width=\"60%\" border=\"0\" cellpadding=\"8\" bgcolor=\"#aa9fff\">\n";
    print " <tr>\n";
    print " <td height=\"30\" align=\"center\">页面转向提示信息</td>\n";
    print " </tr>\n";
    print " <tr>\n";
    print " <td align=\"center\">$info</td>\n";
    print " </tr>\n";
    print " <tr>\n";
    print " <td align=\"center\">\n";
    print " <a href=\"$url\">如果你的浏览器不支持自动跳转,请按这里</a></td>\n";
    print " </tr>\n";
    print " </tr>\n";
    print " </table></td>\n";
    print " </tr>\n";
    print " <tr>\n"; //开源
    print " <td height=\"200\"> </td>\n";
    print " </tr>\n";
    print "</table>\n";
    print "</body>\n</html>";
    exit;
?>

php重定向

方法一:header("location: index.php");  
方法二:echo "<scrīpt>window.location ="$php_self";</scrīpt>"; 
//开源代码 
方法三:echo "<meta http-equiv="refresh" content="0; url=index.php">";


教程链接:http://www.phprm.com/develop/fs981.html

随意转载~但请保留教程地址★

标签:重定向 页面 快速转向

相关文章

发表留言