COMPUTER LEARNING CENTER
WWW.HUUKHANG.COM
1.2.
Bieán form töø form ñöôïc submit vôùi phöông thöùc GET
Neáu baïn söû duïng phöông thöùc GET trong theû form, baïn coù theå laáy giaù trò cuûa caùc
tham soá treân chuoãi QueryString baèng bieán form. Ví duï khai baùo theû form coù hai tuyø
choïn nhö ví duï 4-2 vôùi phöông thöùc GET trong theû form.
Ví duï 4-2: Khai baùo theû form
...
<form action=ex2-1.php method=get>
<tr><td>Province</td>
<td>
:<select
name=province>
<option value=HAN>Ha Noi</option>
<option value=HCM>Ho Chi Minh</option>
<option
value=HUE>Hue</option>
</select>
</td></tr>
<tr><td>Industry</td>
<td>
:<select name=industry multiple>
<option
value=AUT>Automobile</option>
<option
value=FOO>Foods</option>
<option
value=ENG>Enginering</option>
<option
value=GAR>Garment</option>
</select>
</td></tr>
<tr><td> </td>
<td><input type=submit value=Submit></td></tr>
</form>
...
Khi trieäu goïi trang ex2.php treân trình duyeät, ngöôøi söû duïng choïn giaù trò trong hai
tuyø choïn Province vaø Industry nhö hình 4-2.
Hình 4-2: Phöông thöùc GET
Giaùo vieân: Phaïm Höõu Khang