简体   繁体   English

PHP的输入类型的文字没有给新的价值

[英]php input type text not giving new value

Ok here is my case 好的,这是我的情况

  1. i have and its value is get from mysql *let's say its value is 500.91 我有,它的值是从mysql获取的*假设它的值是500.91

  2. i changed its value from phpmyadmin into 500.9 我将其值从phpmyadmin更改为500.9

  3. at phpmyadmin the value succesfully changed into 500.9 在phpmyadmin处,该值成功更改为500.9

  4. but at my google chrome the value is still 500.91, i have press f5 for refresh and it's still 500.91 但在我的谷歌浏览器中,该值仍为500.91,我按f5键进行刷新,仍为500.91

there are 2 option to have the value changed 1. clear all of cache, history and cookies 2. wait a couple of days and it will changed 有2个选项可以更改值1.清除所有缓存,历史记录和cookie 2.等待几天,它将更改

my question is 我的问题是

How to automatically change the value without clear all history manually or wait for couple days? 如何自动更改值而无需手动清除所有历史记录或等待几天? please help me 请帮我

*database changed but php display not changed *数据库已更改,但php显示未更改


Edit (by Dinistro): 编辑(由Dinistro撰写):

here is the code which was added in the comments: 这是在注释中添加的代码:

<?php 
$query = mysql_query("SELECT * FROM surat_jalan WHERE tanggal >= '$tanggal1' 
AND tanggal <= '$tanggal2 23:59' ORDER BY tanggal ASC"); 

while($row = mysql_fetch_array($query)){ 
?> 
    <td>
        <input type="text" name="volume" value="<?php echo($row['volume']); ?>" />
    </td> 
<?php 
} 
?>
<?php
$display = <<<EOF_;
<table>
 <tr>
  <td>&nbsp;</td>
 </tr>
EOF_;
$query = mysql_query("SELECT * FROM surat_jalan WHERE tanggal >= '$tanggal1' 
AND tanggal <= '$tanggal2 23:59' ORDER BY tanggal ASC"); 
while($row = mysql_fetch_array($query)){
$display .= <<<EOF_;
 <tr>
  <td>
   <input type="text" name="volume" value="$row['volume']" />
  </td>
 </tr> 
EOF_;
}
$display .= <<<EOF_;
</table>
EOF_;
echo"$display";
?>

<input type="“text”" assign id value to php string< div><div id="text_translate"><p> 我有一个模式表单将员工工作时间戳写入 SQL 数据库。 I select 从下拉菜单中选择员工,并使用 id 标签填写 javascript function 姓名和姓氏输入框。 当我提交表单时,数据使用 php 写入数据库。 问题是我无法将 javascript 字符串转换为 php 字符串或将输入标签的 id 标签分配给 php 字符串。 我知道在输入中写入我可以用 php value="...." 分配值。</p><pre> $nome = '&lt;script&gt;document.writeln(a);&lt;/script&gt;';</pre><p> 不工作</p><p>这里的代码</p><pre>&lt;div class="modal-body"&gt; &lt;input type="hidden" name="edit_id" value="&lt;?php echo $id; ?&gt;"&gt; &lt;div class="form-group"&gt; &lt;label class="control-label col-sm-2" for="dipendente"&gt;Dipendente:&lt;/label&gt; &lt;div class="col-sm-4"&gt; &lt;select id="dipendente" name="dipendente" onchange="nomeCognome()"&gt; &lt;option value="dipendente"&gt;Seleziona dipendente&lt;/option&gt; &lt;?php $sqlOperatore="SELECT nome, cognome FROM login ORDER BY nome ASC"; $resultOperatore = $conn-&gt;query($sqlOperatore); if ($resultOperatore-&gt;num_rows &gt; 0) { while($row = $resultOperatore-&gt;fetch_assoc()) { $nome = $row['nome']; $cognome = $row['cognome']; $dipendente = $nome. ' '. $cognome; ?&gt; &lt;option&gt;&lt;?php echo $dipendente; ?&gt;&lt;/option&gt; &lt;?php }?&gt; &lt;/select&gt; &lt;/div&gt; &lt;?php }?&gt; &lt;label class="control-label col-sm-2" for=" "&gt; &lt;/label&gt; &lt;div class="col-sm-4"&gt;&lt;/div&gt; &lt;/div&gt; &lt;br&gt; &lt;div class="form-group"&gt; &lt;label class="control-label col-sm-2" for="nome"&gt;Nome:&lt;/label&gt; &lt;div class="col-sm-4" id="nome"&gt; &lt;input type="text" class="form-control" id="nome" name="nome" readonly&gt; &lt;/div&gt; &lt;label class="control-label col-sm-2" for="cognome"&gt;Cognome:&lt;/label&gt; div class="col-sm-4" id="cognome"&gt; &lt;input type="text" class="form-control" id="cognome" name="cognome" readonly&gt; &lt;/div&gt; &lt;/div&gt; &lt;br&gt; &lt;script type="text/javascript"&gt; function nomeCognome() { var x = document.getElementById("dipendente").value; var [a, b, c] = x.split(' '); document.getElementById("nome").innerHTML = [a]; document.getElementById("cognome").innerHTML = [b, c].join(' '); } &lt;/script&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="submit" class="btn btn-primary" name="add_item"&gt;&lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; Aggiungi&lt;/button&gt; &lt;button type="button" class="btn btn-warning" data-dismiss="modal"&gt;&lt;span class="glyphicon glyphicon-remove-circle"&gt;&lt;/span&gt; Annulla&lt;/button&gt; &lt;/div&gt; &lt;?php //Add Matricola if(isset($_POST['add_item'])){ $edit_id = $_POST['edit_id']; $nome = $_POST['nome']; $cognome = $_POST['cognome']; $sql = "INSERT INTO gest_personale.timbratura (nome, cognome) VALUES ('$nome', '$cognome')"; if ($conn-&gt;query($sql) === TRUE) { echo '&lt;script&gt;window.location.href="visualizzaTimbrature.php"&lt;/script&gt;'; } else { echo "Errore: ". $sql. "&lt;br&gt;". $conn-&gt;error; } }?&gt;</pre><p> 我收到以下错误/通知:注意:未定义的索引:nome 和注意:未定义的索引:cognome</p></div> - <input type=“text” assign id value to php string

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 输入区域中的新行显示PHP错误 - New line in the input area giving error in PHP 使用$ _GET PHP通过URL传递输入类型的文本值 - Pass input type text value through URL using $_GET PHP <input type="“text”" assign id value to php string< div><div id="text_translate"><p> 我有一个模式表单将员工工作时间戳写入 SQL 数据库。 I select 从下拉菜单中选择员工,并使用 id 标签填写 javascript function 姓名和姓氏输入框。 当我提交表单时,数据使用 php 写入数据库。 问题是我无法将 javascript 字符串转换为 php 字符串或将输入标签的 id 标签分配给 php 字符串。 我知道在输入中写入我可以用 php value="...." 分配值。</p><pre> $nome = '&lt;script&gt;document.writeln(a);&lt;/script&gt;';</pre><p> 不工作</p><p>这里的代码</p><pre>&lt;div class="modal-body"&gt; &lt;input type="hidden" name="edit_id" value="&lt;?php echo $id; ?&gt;"&gt; &lt;div class="form-group"&gt; &lt;label class="control-label col-sm-2" for="dipendente"&gt;Dipendente:&lt;/label&gt; &lt;div class="col-sm-4"&gt; &lt;select id="dipendente" name="dipendente" onchange="nomeCognome()"&gt; &lt;option value="dipendente"&gt;Seleziona dipendente&lt;/option&gt; &lt;?php $sqlOperatore="SELECT nome, cognome FROM login ORDER BY nome ASC"; $resultOperatore = $conn-&gt;query($sqlOperatore); if ($resultOperatore-&gt;num_rows &gt; 0) { while($row = $resultOperatore-&gt;fetch_assoc()) { $nome = $row['nome']; $cognome = $row['cognome']; $dipendente = $nome. ' '. $cognome; ?&gt; &lt;option&gt;&lt;?php echo $dipendente; ?&gt;&lt;/option&gt; &lt;?php }?&gt; &lt;/select&gt; &lt;/div&gt; &lt;?php }?&gt; &lt;label class="control-label col-sm-2" for=" "&gt; &lt;/label&gt; &lt;div class="col-sm-4"&gt;&lt;/div&gt; &lt;/div&gt; &lt;br&gt; &lt;div class="form-group"&gt; &lt;label class="control-label col-sm-2" for="nome"&gt;Nome:&lt;/label&gt; &lt;div class="col-sm-4" id="nome"&gt; &lt;input type="text" class="form-control" id="nome" name="nome" readonly&gt; &lt;/div&gt; &lt;label class="control-label col-sm-2" for="cognome"&gt;Cognome:&lt;/label&gt; div class="col-sm-4" id="cognome"&gt; &lt;input type="text" class="form-control" id="cognome" name="cognome" readonly&gt; &lt;/div&gt; &lt;/div&gt; &lt;br&gt; &lt;script type="text/javascript"&gt; function nomeCognome() { var x = document.getElementById("dipendente").value; var [a, b, c] = x.split(' '); document.getElementById("nome").innerHTML = [a]; document.getElementById("cognome").innerHTML = [b, c].join(' '); } &lt;/script&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="submit" class="btn btn-primary" name="add_item"&gt;&lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; Aggiungi&lt;/button&gt; &lt;button type="button" class="btn btn-warning" data-dismiss="modal"&gt;&lt;span class="glyphicon glyphicon-remove-circle"&gt;&lt;/span&gt; Annulla&lt;/button&gt; &lt;/div&gt; &lt;?php //Add Matricola if(isset($_POST['add_item'])){ $edit_id = $_POST['edit_id']; $nome = $_POST['nome']; $cognome = $_POST['cognome']; $sql = "INSERT INTO gest_personale.timbratura (nome, cognome) VALUES ('$nome', '$cognome')"; if ($conn-&gt;query($sql) === TRUE) { echo '&lt;script&gt;window.location.href="visualizzaTimbrature.php"&lt;/script&gt;'; } else { echo "Errore: ". $sql. "&lt;br&gt;". $conn-&gt;error; } }?&gt;</pre><p> 我收到以下错误/通知:注意:未定义的索引:nome 和注意:未定义的索引:cognome</p></div> - <input type=“text” assign id value to php string 在php中使用输入类型文本时获取select2的值 - Get value of select2 when using input type text in php PHP验证-输入类型“文本”值必须是一个特定的单词 - PHP validation - input type“text” value must be one specific word PHP Multiple输入类型文本和输入类型文件格式输出到数组名称和带有数组Sequence的值 - PHP Multiple Input type Text and input type File form output to array name and Value with array Sequence PHP:用值计算输入类型 - PHP: Count input type with value 输入类型文本php中的背景文本 - Background text in input type text php PHP 将文本发送到<input type="“text”"> - PHP sending text to a <input type=“text”> 输入类型文本字段给出固定错误2147483647 - input type text field giving fixed error 2147483647
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM