have trouble in a if condition


Posted on 16th Feb 2014 07:03 pm by admin

The if below is working ok, it check when indexes, name, zipcode and state are empty.
Code: <?php
if ( trim($_POST['name']) == '' && $_POST['zipcode'] =='' && $_POST['state'] ==''
?>

But when it comes to check the array types I don't know how to structure in a way that it checks weather is empty or not. I did it as below and it fails the test. How can I insert the types index array and check when is empty? empty meaning when there is not value remembering that it is an array now.

Code: if ( trim($_POST['name']) == '' && $_POST['zipcode'] =='' && $_POST['state'] =='' && isset($_POST['frmSearch']['types']) )
{ this}
else
{that}
?>

No comments posted yet

Your Answer:

Login to answer
292 Like 43 Dislike
Previous forums Next forums
Other forums

Quick fix: Conditional statement with an array
Hi, I'm getting the temperature value off of the Environment Canada website along with the icon file

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the Fr

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

Having problemswith multithreading and prime numbers
I have an assignment when I'm suppose to do the following:

Write a multithreaded Java, Pt

form problem
Hi all, I think this is going to be easy to resolve but for I have been looking at it to long and I

contact form - output to page and email
I have the following in my controller:

$message['name'] = htmlentities(strip_tags(trim($_POST

Internal class functions don't seem to get executed.
Hi. Can someone please put me out of my misery on this. I don't write much PHP and this has me baffl

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash