我无法在html文本框中访问我的php变量值。下面是我在wordpress页面中编写的php代码
[php]
global $wpdb;
$resultCustomerID = $wpdb->get_results ("select max(CustomerID) as LatestCustomer from CustomerPhoneInfo");
foreach ( $resultCustomerID as $printCustomerID )
{
$CurrentCustomerID = ($printCustomerID->LatestCustomer) + 1;
}
echo 'current customer id:' . $CurrentCustomerID;
[/php]
我可以打印$ CurrentCustomerID值,但无法在html文本框控件中使用它。下面是我的HTML代码。
<form method="post">
<table>
<tr>
<td>Customer ID:</td>
<td><input id="txtCustomerID" type="text" name="txtCustomerID" value="[php] echo $CurrentCustomerID; [/php]" disabled /></td>
</tr>
</table>
</form>