iT邦幫忙

0

PHP URL變數,判斷式 相關

第三個ELSEIF讀不到.......
急求解/images/emoticon/emoticon02.gif

<?php  
    $p = $_GET['p'];
    //內容
	if($p == 'home'){                

        include("pages/home.php");   //首頁

    }elseif ($p == 'about'){

        include("pages/about.php");    //關於我們
        
    }elseif($p = 'list'){

        include("pages/list.php");   //文章列表

    }

?> 

/images/emoticon/emoticon18.gif

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

1
$p = 'list'

發現了沒?
常犯錯誤下次要小心點喔!

QR摳 iT邦新手 5 級 ‧ 2020-07-25 21:13:31 檢舉

感謝 /images/emoticon/emoticon07.gif

1
kenzxc6214
iT邦見習生 ‧ 2020-07-25 20:18:50

你最後一個的 elseif 裡的判斷式 = 是要寫成 ==

QR摳 iT邦新手 5 級 ‧ 2020-07-25 21:14:50 檢舉

感謝您,但樓上已解答了/images/emoticon/emoticon12.gif

QR摳 iT邦新手 5 級 ‧ 2020-07-25 21:18:33 檢舉

(從學Python到C語言,現在到了PHP都錯過XD

我要發表回答

立即登入回答