動態URL MySQL數據庫具有以下三列:Rediricting從動態填充鏈接
id url_href url
1 yahoo http://www.yahoo.com
2 google http://www.google.com
3 bing http://www.bing.com
我用下面的查詢來獲取價值
mysql_select_db($database_XYZ, $XYZ);
$query_urlencoder = "SELECT id, url_href, url FROM sites WHERE id >0 ORDER BY id DESC";
$urlencoder = mysql_query($query_urlencoder, $XYZ) or die(mysql_error());
$row_urlencoder = mysql_fetch_assoc($urlencoder);
$totalRows_urlencoder = mysql_num_rows($urlencoder);
的href標記
<a href="redirect.php?encodeurl=<?php echo $row_urlencoder['url']; ?>" target="_blank"><?php echo $row_urlencoder['url_href']; ?></a>
基於重複區域動態地在頁面上填充鏈接,如
個yahoo
google
bing
,點擊上面鏈接把用戶分別
http://www.examplecom/redirect.php?encodeurl=http://www.yahoo.com
http://www.example.com/redirect.php?encodeurl=http://www.google.com
http://www.example.com/redirect.php?encodeurl=http://www.bing.com
,但那些實際並不重定向到相應的網址類似
http://www.yahoo.com
http://www.google.com
http://www.bing.com
我如何可以重定向HREF鏈接到在這種情況下的上述網址?任何建議或參考應感謝讚賞。
是你的重定向。PHP是正確的,並指向所需的網址正確 – 2013-02-18 11:19:40
是的,否則我將無法打開URL'http://www.site.com/redirect.php?encodeurl=http://www.yahoo。 com'。如果redirect.php不正確,網址會被打開嗎?我很好奇學習它。 – 2013-02-18 11:30:21