欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > php >内容正文

php

html显示php值,HTML窗体加载显示通过PHP的十六进制值

发布时间:2023/12/19 php 33 豆豆
生活随笔 收集整理的这篇文章主要介绍了 html显示php值,HTML窗体加载显示通过PHP的十六进制值 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

我想动态加载一个窗体,将填充从SQL数据库中的行数。数据返回一个十六进制颜色,名称和价格。我想在窗体和POST上向用户显示颜色和名称,我想发送附加到该特定颜色的价格。我花了整整一天的时间来弄清楚这一点。HTML窗体加载显示通过PHP的十六进制值

任何帮助将不胜感激!

编辑:这里(这是我迄今为止

代码:

$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:
     

    我只是不知道如何获得选定的指数,并发布“$价格[selectedIndex]”

    +1

    你在一天结束时想出了什么代码?也许我们可以建立在 –

    2013-03-22 05:46:40

    总结

    以上是生活随笔为你收集整理的html显示php值,HTML窗体加载显示通过PHP的十六进制值的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。