如何在php中发布文本框值? [英] How do I post the textbox value in php?
本文介绍了如何在php中发布文本框值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在php中创建两个页面,我需要将一个页面中的文本框值发布到另一个页面..我试过了,
< 表格 action = test11.php name = firstSubmit 方法 = POST >
< p > 总数。正确答案:
< 输入 类型 = text 名称 = ans value = <?php echo $ right_answer;?> 已禁用 / > < / p >
< p < span class =code-keyword>> 总数。错误答案:
< input 名称 = 错误 type = text id = score1 value = <?php echo $ wrong_answer;?> 已禁用 / > < / p >
< p > 总数。未解决的问题:
< 输入 名称 = unans type = text id = score2 value = <?php echo $ unanswered;?> 已禁用 / > < / p >
< 按钮 class = btn btn-success btn-block 类型 = 提交 >
获取证书
< /按钮 > < br > < br >
< / form >
和,
<?php
$ s = $ _POST [' ans'];
?>
但它会显示错误比如注意:未定义的索引:第2行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\这...
提前致谢,
Priya
解决方案
right_answer;?> 已禁用 / > < / p >
< p > 错误答案总数:
< 输入 名称 = 错误 type = text id = score1 值 = <?php echo
wrong_answer ;?> 已禁用 / > < < span class =code-leadattribute> / p >
< p > 总数。未解决的问题:
< 输入 名称 = unans type = text id = score2 value = <?php echo
未答复;?> 已禁用 / > < / p >
< 按钮 class = btn btn-success btn-block type = 提交 >
获取证书
< / button > < br > < br >
< / form >
和,
<?php
Hi all,
I'm creating two pages in php and I need to post the textbox value in one page to another page.. I've tried,
<form action="test11.php" name="firstSubmit" method="POST">
<p>Total no. of right answers :
<input type="text" name="ans" value="<?php echo $right_answer;?>" disabled /></p>
<p>Total no. of wrong answers :
<input name="wrong" type="text" id="score1" value="<?php echo $wrong_answer;?>" disabled /></p>
<p>Total no. of unanswered questions :
<input name="unans" type="text" id="score2" value="<?php echo $unanswered;?>" disabled /></p>
<button class="btn btn-success btn-block" type="submit">
Get your certificate
</button><br><br>
</form>
and,
<?php
$s = $_POST['ans'];
?>
But it will shows the error like "Notice: Undefined index: ans in C:\xampp\htdocs\nquiz1\test11.php on line 2".
Help me to do this...
Thanks in advance,
Priya
解决方案
right_answer;?>" disabled /></p> <p>Total no. of wrong answers : <input name="wrong" type="text" id="score1" value="<?php echo
wrong_answer;?>" disabled /></p> <p>Total no. of unanswered questions : <input name="unans" type="text" id="score2" value="<?php echo
unanswered;?>" disabled /></p> <button class="btn btn-success btn-block" type="submit"> Get your certificate </button><br><br> </form>
and,
<?php
这篇关于如何在php中发布文本框值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文