0

Why I cant set value with echo variable in text form jquery eui?

<input type="text" name="text1" class="easyui-validatebox" value="<? echo $varPhp; ?>" size="53"/></td>

My php function like this..

<?php
        $query = "SELECT MAX(kode_barang) as maxID FROM tb_barang";
        $hasil = mysql_query($query);
        $data  = mysql_fetch_array($hasil);
        $idMax = $data['maxID'];
        $noUrut = (int) substr($idMax, 1, 4);
        $noUrut++;
        $varPhp = "B" . sprintf("%04s", $noUrut);
        ?>

Anyone can help me?

Question Closed.. :) i pass the process and create in model.

4

3 回答 3

1

May be your php version doesnt support the use of short tags.Check the documentation .And try this

<input type="text" name="text1" class="easyui-validatebox" value="<?php echo $varPhp; ?>" size="53"/>
于 2013-10-16T07:04:35.820 回答
1

Try

<?php echo $varPhp; ?> 
于 2013-10-16T07:05:07.467 回答
1

我假设你的变量是空的。

为确保这一点,请使用 var_dump 转储它。

尝试这个:

<input type="text" name="text1" class="easyui-validatebox" value="<?php var_dump($varPhp); ?>" size="53"/>
于 2013-10-16T08:11:37.377 回答