找回密碼
 註冊
搜索
查看: 7081|回復: 5

[教學] 幾種網頁轉址的語法

  [複製鏈接]
發表於 2010-9-14 12:08:21 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
HTML
  1. <head> <meta http-equiv=refresh content="0;url=http://host.domain.tld/path/to/"> </head>
複製代碼
JavaScript
  1. <script language="JavaScript">
  2. <!--
  3.   window.location.href = "http://host.domain.tld/path/to/";
  4. //-->
  5. </script>
複製代碼
PHP
  1. <?php
  2.   header("Location: http://host.domain.tld/path/to/");
  3. ?>
複製代碼
(轉址前不可有任何資料輸出)Perl
  1. #!/usr/bin/perl -w
  2. print "Location: http://host.domain.tld/path/to/ \n\n";
複製代碼
(轉址前不可有任何資料輸出)Perl – 使用 CGI 模組
  1. #!/usr/bin/perl -w
  2. use CGI qw/:standard/;
  3. my $CGI = CGI->new();
  4. print $CGI->redirect("http://host.domain.tld/path/to/");
複製代碼
 
發表於 2013-11-14 00:43:30 | 顯示全部樓層
拿分走人呵呵,樓下繼續!
版主招募中
發表於 2013-11-14 00:43:30 | 顯示全部樓層
天啊.  
發表於 2013-11-14 00:43:30 | 顯示全部樓層
知道了 不錯~~~  
發表於 2014-7-2 06:59:45 | 顯示全部樓層
回复一下吧











bjcars.net
發表於 2014-10-29 02:03:57 | 顯示全部樓層
谢谢分享!!
爱美肌aimgam.com/
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-4-30 21:22 , Processed in 0.020628 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表