PHP重定向和页面快速转向
栏目:php教程时间:2013-11-18 06:01:16
页面快速转向
- <?
- 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";
- 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">";
- ?>
------分隔线----------------------------
------分隔线----------------------------