[請益] 點選圖片無法啟動php程式
HTML code如下,
xxxxxxx.php目的在於讓圖片點擊後隨機load另一張圖
此段code的目的是,當點擊圖片後會重新refresh網址,
並且會啟動php,
<a href="http://我的網址">
<img src="http://我的網址/xxxxxx.php">
</a>
=========
xxxxxx.Php code 如下
<?php
$temp=(mt_rand(1,3));
switch ($temp)
{
Case "1":
$ad1="XXX.jpg";
header("Location: ".$ad1);
exit;
break;
Case "2":
$ad2="XXXX.jpg";
header("Location: ".$ad2);
exit;
break;
Case "3":
$ad3="xxxxxx.jpg";
header("Location: ".$ad3);
exit;
break;
}
?>
點擊圖片重新reload網址後 圖片並無"隨機" 還是延續第一次開啟網頁的圖片~
但是如果將瀏覽器重新refresh 圖片卻有隨機...
實在不知道是哪邊出了問題 請各位大大指點 拜託拜託
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.123.71.67
推
01/23 23:31, , 1F
01/23 23:31, 1F
→
01/23 23:44, , 2F
01/23 23:44, 2F
→
01/25 15:30, , 3F
01/25 15:30, 3F
推
01/25 22:37, , 4F
01/25 22:37, 4F
推
01/27 21:42, , 5F
01/27 21:42, 5F
推
02/05 08:29, , 6F
02/05 08:29, 6F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章