帮助发布条件if语句 [英] help with posting conditional if statement

查看:63
本文介绍了帮助发布条件if语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以提供帮助。我已经尝试将脚本缩小到最低限度并且

它仍然无法正常工作。我认为应该发生的是,当

字段app_fname为空时,$ hold_chk将设置为1并且第一个

if语句将被执行。实际发生的是当我点击

提交时,表单保持原样,例如,如果提交

按钮所在的表单位于其他表单上。 php,然后当我点击提交时这是

它留在哪里。如果我第二次点击提交按钮,它会发布到

some.php表单。我已经尝试了这个没有条件的脚本if(isset()

并且它有效。我需要有isset()否则表单显示所有

空字段一旦它加载,在提交按钮被击中之前。任何帮助

将不胜感激。在这个工作了2周之后,好像我已经卡住了b $ b 。


谢谢

艺术


<?php


$ holdchk = 0;


if(isset($ _ POST [''B1''])){


echo"< ; br>< br>< br>" ;;

if(空($ _ POST [''app_fname''])){

$ holdchk = 1 ;

}


if($ holdchk == 1){

echo"< form method = \ ; POST \" action = \" some.php \">" ;;


}


if ($ holdchk == 0){

echo"< form method = \" POST \" action = \" other.php \">" ;


}

}

?>


< html>


< head>

< / head>


< form method =" POST"动作="">




点击提交按钮< / font>< / b< input

type =" submit"值= [提交" name =" B1">< / p>

< / form>

< / body>


< / html>

解决方案

hold_chk将设置为1和第一个

if语句将被执行。实际发生的是当我点击

提交时,表单保持原样,例如,如果提交

按钮所在的表单位于其他表单上。 php,然后当我点击提交时这是

它留在哪里。如果我第二次点击提交按钮,它会发布到

some.php表单。我已经尝试了这个没有条件的脚本if(isset()

并且它有效。我需要有isset()否则表单显示所有

空字段一旦它加载,在提交按钮被击中之前。任何帮助

将不胜感激。在这个工作了2周之后,好像我已经卡住了b $ b 。


谢谢

艺术


<?php


holdchk = 0;


if(isset(


_POST [''B1''])){


echo"< br>< br>< br>" ;;

if(empty(


Can anyone help. I''ve tried scaling down a script to the bare minimum and
it still is not working correctly. What I think should happen is that when
the field app_fname is blank, that $hold_chk will get set to 1 and the 1st
if statement will be executed. What actually happens is that when I hit
submit, the form stays where it is, for example if the form where the submit
button is located is on the form other.php, then when I hit submit this is
where it stays. If I then hit the submit button a 2nd time, it post to the
some.php form. I''ve tried this script without the conditional if(isset()
and it works. I need to have the isset() otherwise the form displays all
empty fields as soon as it loads, before the submit button is hit. Any help
would be appreciated. After working on this for 2 weeks it seems like i''m
stuck.

Thanks
Art

<?php

$holdchk = 0;

if (isset($_POST[''B1''])) {

echo "<br><br><br>";
if (empty($_POST[''app_fname''])) {
$holdchk = 1;
}

if ($holdchk == 1 ){
echo "<form method=\"POST\" action=\"some.php\">";

}

if ($holdchk == 0 ){
echo "<form method=\"POST\" action=\"other.php\">";

}
}
?>

<html>

<head>
</head>

<form method="POST" action="">

When
hit the submit button</font></b<input
type="submit" value="Submit" name="B1"></p>
</form>
</body>

</html>

解决方案

hold_chk will get set to 1 and the 1st
if statement will be executed. What actually happens is that when I hit
submit, the form stays where it is, for example if the form where the submit
button is located is on the form other.php, then when I hit submit this is
where it stays. If I then hit the submit button a 2nd time, it post to the
some.php form. I''ve tried this script without the conditional if(isset()
and it works. I need to have the isset() otherwise the form displays all
empty fields as soon as it loads, before the submit button is hit. Any help
would be appreciated. After working on this for 2 weeks it seems like i''m
stuck.

Thanks
Art

<?php


holdchk = 0;

if (isset(


_POST[''B1''])) {

echo "<br><br><br>";
if (empty(


这篇关于帮助发布条件if语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆