Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
If statement 检查多个文本框是否为空,如果不是,则执行PHP_If Statement_Textbox - Fatal编程技术网

If statement 检查多个文本框是否为空,如果不是,则执行PHP

If statement 检查多个文本框是否为空,如果不是,则执行PHP,if-statement,textbox,If Statement,Textbox,试试下面的PHPcode <? if ($_POST['username'] == NULL){ //if nothing is entered or only a zero is entered echo "Missing a field."; }else{ //rest of code } 这对我有用。如果为空,则重定向一个对话框窗体,否则执行作业,该作业就是要执行的insert语句 加入Missionsoft Programming Institute

试试下面的
PHP
code

<?
  if ($_POST['username'] == NULL){ //if nothing is entered or only a zero is entered
    echo "Missing a field.";
  }else{
    //rest of code
  }

这对我有用。如果为空,则重定向一个对话框窗体,否则执行作业,该作业就是要执行的insert语句


加入Missionsoft Programming Institute(mtscertification.com)

您能进一步解释您的问题吗?
<?
if ($_POST['username'] == NULL || 
    $_POST['password'] == NULL || 
    $_POST['email'] == NULL)
{ //if nothing is entered or only a zero is entered
echo "Missing a field.";
}else{
//rest of code
}
if(empty($_POST['memberfullname'])){ 
    header("Location:srgbusinesspartnersmsg.php");
 } else {
    $insert= $con->command($ins);
    header("Location:srgvalidatepartners.php");
}