2015-02-04 46 views
1

我打算做一個網站,有這樣的功能:http://www.hwcompare.com/category/gpu/HTML選定值的聲明如果PHP

我不能得到的代碼整理出來,以顯示圖片,文字和一些基準我希望基於用戶選擇的值。

HTML代碼:

<html> 
<head> 
    <title> Compare Master - The Master at System Comparison! </title> 
</head> 
<body> 
Select a GPU you want to compare: <br> 
<form action="compare.php" method="GET"> 
<select name="lelo" id="lelo"> 
<optgroup label="Radeon HD Series"> 
    <option value="Radeon 3470">Radeon HD 3470</option> 
    <option value="Radeon 3650">Radeon HD 3650</option> 
</optgroup> 
<optgroup label="Radeon R7 Series"> 
    <option value="R7 240">Radeon R7 240</option> 
    <option value="R7 250">Radeon R7 250</option> 
</optgroup> 
</select> 
<br><input type="submit" name="submit" value="Submit your selections" /> 
</form> 
</body> 

和我的PHP代碼:

<?php 
    $gpu1 = $_GET['lelo']; 
echo $gpu1; 
?> 

而且我想我的PHP像工作..例如:如果(期權價值=「R7 240 '){ display R7 240 image + R7 240 specifications}

+0

查找Ajax和HTML選擇。 – Dimitri

回答

0
<?php 
$gpu1 = $_GET['lelo']; 
if($gpu1=='R7 240'){ 
echo '<img src='your source '>' 
} 
?> 

也是動力之源讓您img通過php那麼只有改變img源,只要你想

+0

同樣的基準和文本,對吧? –

+0

我建議你將你的文本轉換爲img,然後通過Paint或其他img編輯器使用 – Ega

+0

好的非常感謝! :d –