我使用的選擇題,以html:
<form target="POPUPW"
onsubmit="POPUPW = window.open('about:blank','POPUPW','width=400,height=400');" name="search1" action="popresult.php" method="POST">
<b>အကၡရာ</b>
<select name="pre">
<option value="c1">က</option>
<option value="c2">ခ</option>
<option value="c3">ဂ</option>
<option value="c4">ဃ</option>
<option value="c5">င</option>
<option value="c6">စ</option>
<option value="c7">ဆ</option>
<option value="c8">ဇ</option>
<option value="c9">စ်</option>
<option value="c10">ည</option>
<option value="c11">ဋ</option>
<option value="c12">ဌ</option>
<option value="c13">ဍ</option>
<option value="c14">ဎ</option>
<option value="c15">ဏ</option>
<option value="c16">တ</option>
<option value="c17">ထ</option>
<option value="c18">ဒ</option>
<option value="c19">ဓ</option>
<option value="c20">န</option>
<option value="c21">ပ</option>
<option value="c22">ဖ</option>
<option value="c23">ဗ</option>
<option value="c24">ဘ</option>
<option value="c25">မ</option>
<option value="c26">ယ</option>
<option value="c27">ရ</option>
<option value="c28">လ</option>
<option value="c29">၀</option>
<option value="c30">သ</option>
<option value="c31">ဟ</option>
<option value="c32">ဠ</option>
<option value="c33">အ</option>
<option value="c34">ကက</option>
<option value="c35">ကခ</option>
<option value="c36">ကဂ</option>
<option value="c37">ကဃ</option>
<option value="c38">ကင</option>
<option value="c39">ကစ</option>
<option value="c40">ကဆ</option>
</select>
<b>Number</b>
<select name="one">
<option value="0">0</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>
</select>
<select name="two">
<option value="0">0</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>
</select>
<select name="three">
<option value="0">0</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>
</select>
<select name="four">
<option value="0">0</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>
</select>
<select name="five">
<option value="0">0</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>
</select>
<select name="six">
<option value="0">0</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>
</select>
<input type="submit" name="search" value="ထီတိုက္ရန္" style="font-family:Zawgyi-One;" />
</form>
我的PHP是
<?php
$output = NULL;
$link = mysqli_connect("localhost","root","","searchdemo") or die("Unable to select database" . mysqli_error($link));
if(isset($_POST['search'])){
$spre = $_POST['pre'];
$sone = $_POST['one'];
$stwo = $_POST['two'];
$sthree = $_POST['three'];
$sfour = $_POST['four'];
$sfive = $_POST['five'];
$ssix = $_POST['six'];
$query = mysqli_query ($link, "SELECT * FROM `346` WHERE pre = '$spre' AND one = '$sone' AND two = '$stwo' AND three = '$sthree' AND four = '$sfour' AND five = '$sfive' AND six = '$ssix'") or die("<b>Error</b> : ".mysqli_error($link));
$count = mysqli_num_rows($query);
if ($count == 0){
$output = 'Try Again';
}else{
while($row = mysqli_fetch_array($query)){
extract($row);
$price = $row['price'];
$output = '<style="font-family:Zawgyi-One">ဂုဏ္ယူ၀မ္းေျမာက္ပါတယ္ခင္ဗ်ာ ... <br />လူႀကီးမင္းဟာ ယခုဆို သိန္းေပါင္း ' .$price. 'ကို ဆြတ္ခူးသြားႏိုင္ပါၿပီ</style>';
}
}
}
?>
<html>
You are searching for <b style="font-family:Zawgyi-One"><?php echo $spre; ?> - <?php echo $sone; ?><?php echo $stwo; ?><?php echo $sthree; ?><?php echo $sfour; ?><?php echo $sfive; ?><?php echo $ssix; ?></b><br /><br />
</html>
<?php
print ("$output <br />");
?>
但是當我搜索,結果在
被證明您正在查找c1 - 000000
但我喜歡將「c1」顯示爲က(က是unicode)。我會將CSV文件導入到我的數據庫中,而不包括unicode。
你可以在php中使用push()方法來存儲每個值。 –
*「我在html中使用多項選擇:」* - 那麼,您需要'foreach',並且您需要爲您的表單和PHP顯示完整的代碼,包括如果您使用正確的語法。 –
這個問題和午夜泥一樣清晰。沒有辦法提供完整的解決方案,直到我們看到用於處理此問題的完整和實際的代碼。 –