Jump to content

if empty statement


Pavlos1316

Recommended Posts

try this example


<?
if($_POST["submit"]=='submit')
{
$a=$_POST["ass"];
$b=$_POST["aaab"];
echo $a;
echo $b;
if(empty($a) && empty($b))
{
echo "empty";
}
}

?>
<form action="" method="post">
<input type="text" name="ass"  />
<input type="text" name="aaab" />
<input type="submit" name="submit" value="submit" />
</form>

Link to comment
https://forums.phpfreaks.com/topic/110548-if-empty-statement/#findComment-567154
Share on other sites

try this example


<?
if($_POST["submit"]=='submit')
{
$a=$_POST["ass"];
$b=$_POST["aaab"];
echo $a;
echo $b;
if(empty($a) && empty($b))
{
echo "empty";
}
}

?>
<form action="" method="post">
<input type="text" name="ass"  />
<input type="text" name="aaab" />
<input type="submit" name="submit" value="submit" />
</form>

That's pretty much what I suggested. And don't use short tags -.-
Link to comment
https://forums.phpfreaks.com/topic/110548-if-empty-statement/#findComment-567158
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.