html显示php值,HTML窗体加载显示通过PHP的十六进制值
我想動(dòng)態(tài)加載一個(gè)窗體,將填充從SQL數(shù)據(jù)庫(kù)中的行數(shù)。數(shù)據(jù)返回一個(gè)十六進(jìn)制顏色,名稱和價(jià)格。我想在窗體和POST上向用戶顯示顏色和名稱,我想發(fā)送附加到該特定顏色的價(jià)格。我花了整整一天的時(shí)間來弄清楚這一點(diǎn)。HTML窗體加載顯示通過PHP的十六進(jìn)制值
任何幫助將不勝感激!
編輯:這里(這是我迄今為止
代碼:
$query = "SELECT
`name`,
img,
price
FROM `gutter`";
try
{
$stmt = $db->prepare($query);
$stmt->execute();
}
catch(PDOException $ex)
{
die("Failed to run query: " . $ex->getMessage());
}
$rows = $stmt->fetchAll();
$form =
'
foreach($rows as $row):
$prices[] = htmlentities($row['price'], ENT_QUOTES, 'UTF-8');
$form .= '
'.htmlentities($row['name'], ENT_QUOTES, 'UTF-8').' Price: '.htmlentities($row['price'], ENT_QUOTES, 'UTF-8').'';endforeach;
$form .='
';?>
Hruska Gutter Estimator#feedback { font-size: 1.4em; }
#selectable .ui-selecting { background: #000000; }
#selectable .ui-selected { background: #000000; color: white; }
#selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
#selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
$(function() {
$("#selectable").selectable({
stop: function() {
var result = $("#select-result").empty();
$(".ui-selected", this).each(function() {
var index = $("#selectable li").index(this);
result.append("" + (index + 1));
return index;
});
}
});
});
New Gutter Estimator!
| Gutter Color: | none |
| Board Feet: | |
| Number of Spouts: | |
| E-mail to Recieve Estimate: | |
| Additional Comments: | |
| ? |
我只是不知道如何獲得選定的指數(shù),并發(fā)布“$價(jià)格[selectedIndex]”
+1
你在一天結(jié)束時(shí)想出了什么代碼?也許我們可以建立在 –
2013-03-22 05:46:40
總結(jié)
以上是生活随笔為你收集整理的html显示php值,HTML窗体加载显示通过PHP的十六进制值的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 官方爆料最致命!vivo X Fold2
- 下一篇: 1 亿像素:中兴 Axon 40 Pro