我想解決一個PHP的練習,我不知道如何顯示網站的不同部分。我知道你可以使用開關包含其他頁面(.php)。php會話和不同的頁面瀏覽量
基本上,如果你訪問網站的第一次,你會看到消息:孩子無聊,帶他們去公園(鏈接),按下鏈接後,您將獲得進入公園的景色和它的消息顯示球圖片和三個孩子的照片。如果你點擊球,一個孩子(隨機選擇)會得到一個接球,你將被帶回家/默認視圖。捕獲量將保存在會話中,所以如果你回到公園,你會看到誰抓到了球,你可以重複這個過程。你能給我一些提示怎麼做嗎?由於
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
#children {
float:left;
margin: 0px 100px;
}
#ball {
margin:100px;
}
</style>
</head>
<body>
<!-- Use this to make different page views -->
<!-- home -->
<p>Children are bored, take them to <a href="?mode=park">park</a></p>
<!-- park -->
<p>For children to be more fun, throw them a ball, you can also go <a href="?mode=home">back home</a></p>
<div id="children">
<!-- Repeat this part to make 3 children -->
<div>
<img src="child.png" alt="child" width="100"/><br/>
here child's name - here amount of balls child has caught.
</div>
<!-- end -->
</div>
<div id="ball">
<a href="?mode=throw"> <!--after throwing, add 1 catch to random child and return home page-->
<img src="ball.png" width="100" alt="ball" />
</a>
</div>
</body>
</html>
我會說使用一個cookie,而不是一個會話 – meda