不好意思~
這邊想問一個關於用PHP switch寫查詢高鐵票價的方式
這邊是第一頁的程式碼:
<style type="text/css">
body {
font-size: 100%;
color:#033;
font-family: Verdana, Geneva, sans-serif;
background-color: #FCF;
margin: 0px;
padding: 0px;
}
#button { margin-right: 20px;
margin-left: 20px;
font-family: Verdana, Geneva, sans-serif;
color: #069;
font-size: 0.8em;
}
#button2 { font-family: Verdana, Geneva, sans-serif;
color: #F00;
text-decoration: none;
font-size: 0.8em;
}
#form1 { width: 350px;
margin-right: auto;
margin-left: auto;
text-align: center;
}
</style>
</head>
<body>
<br>
<form id="form1" name="form1" method="post" action="test2.php">
<p>高鐵票價查詢</p>
<p>起點:
<label for="label"></label>
<select name="start" id="to" class="form_jump_02">
<option value="">
請選擇
</option>
<option value='1'>台北</option><option value='2'>板橋</option><option value='3'>桃園</option><option value='4'>新竹</option><option value='5'>台中</option><option value='6'>嘉義</option><option value='7'>台南</option><option value='8'>左營</option>
</select>
</p>
<p> 終點:
<label for="label"></label>
<select name="end" id="to" class="form_jump_02">
<option value="">
請選擇
</option>
<option value='1'>台北</option><option value='2'>板橋</option><option value='3'>桃園</option><option value='4'>新竹</option><option value='5'>台中</option><option value='6'>嘉義</option><option value='7'>台南</option><option value='8'>左營</option>
</select>
</p>
<p>艙別:
<select name="carStyle" id="select3">
<option value="standard">標準</option>
<option value="business">商務</option>
</select>
<label for="label2"></label>
</p>
<p>張數:
<select name="Num" id="select4">
<option value="null">請選擇</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<label for="label3"></label>
</p>
<p>
<input type="submit" name="button" id="button" value="送出查詢" />
<input type="reset" name="button2" id="button2" value="清除重填" />
</p>
</form>
</body>
//這邊是第二頁test2.php
第二頁這邊跟第一頁連結後該怎麼switch去寫呢?
<style type="text/css">
body {
font-size: 100%;
color:#033;
font-family: Verdana, Geneva, sans-serif;
background-color: #FCF;
margin: 0px;
padding: 0px;
}
</style>
</head>
<body>
<?php
$startCar=$_POST['start'];
$endCar=$_POST['end'];
$style=$_POST['carStyle'];
$number=$_POST['Num'];
switch(){
}
?>
</body>
煩請各位指點迷津 謝謝
2個問題需要先確定: