你好stackoverflow用戶,關於php的動態鏈接<a href=""></a>
我的問題是關於php動態鏈接的創建。
我嘗試創建類似的動態鏈接;
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="tr" xml:lang="tr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
<title>Dilşad Çiçekçilik</title>
<script type="text/javascript" src="yoxview/yoxview-init.js"></script>
</head>
<body>
<div class="yoxview">
<?php
...
for($i=0;$i<$images->num_rows();$i++) {
echo "<a href='".$imagesArr[$i]."' ><img src='".$thumbsArr[$i]."' /></a>";
}
....
?>
<?php echo $this->pagination->create_links(); ?>
</div>
</body>
</html>
我的問題從行開始;
echo "<a href='".$imagesArr[$i]."' ><img src='".$thumbsArr[$i]."' /></a>";
$imagesArr[$i] contains the url -->"yoxview/gallery/sevgiliye/images/anneye10.jpg"
$thumbsArr[$i] contains the url -->"yoxview/gallery/sevgiliye/thumbs/anneye10.jpg"
但是,產生創造這樣的鏈接html頁面:
.http://localhost/codeigniter/galleryController/index/yoxview/gallery/sevgiliye/images/anneye10.jpg
.http://localhost/codeigniter/galleryController/index/yoxview/gallery/sevgiliye/thumbs/anneye10.jpg
我的控制器名稱「galleryController」和我的函數名稱「index」和其他基礎url在href之前添加鏈接。
我要創建的鏈接僅包含
yoxview /畫廊/ sevgiliye /圖片/ anneye10.jpg
這個網址。
我該如何實現這一目標?
謝謝。
+1,是的...... –
Hımmok我嘗試了你的建議,我試過了; echo「」; 但URL轉向http://localhost/yoxview/gallery/sevgiliye/images/anneye10.jpg Codeigniter無法找到路徑。我的形象是真實的道路; htdocs/codeigniter/yoxview/gallery/sevgiliye/images/anneye10.jpg 我該如何指出我的圖片鏈接? –
好吧,我錯過了「codeigniter」(我的項目名稱)的片段。我更新了代碼; 「,它的工作原理!感謝您的關注。:) –