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

Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Contents of variable not echoing
Hey guys, hopefully this is an easy one...

In this line, the variables are not echoing out. T

Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to

Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database i

Is this Safe or Unsafe?
Hi i made a few pages with lots of peoples help now i just want to know if they are safe or not can

Force download script not handling files with spaces properly
I have a regular old php force download script, uses this code:

Code: header("Cache-Cont

Help with echo()
I'm having some problems with this code:

Code: echo '
<A HREF="jav

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