Question: How can I show or hide div depending on result come from server, in the file that handle the request, I get a customer object from db, depending on user request, if I didn't find the corresponding customer I want to hide a div .

here's my php code

```
 $customer=getCustomerViaCellPhone($link,$cellPhoneNo);
if(!$customer){
   $error = 'No result found';
}

```

here's the view 

```
<div id="customerInfo" class="<?php (is_null($customer))?'hide':''?>">
....
</div>

```

but it shows the div in both cases

Answer: 
You are missing the command `echo` in your example so it should be:

```
<div id="customerInfo" class="<?php echo (is_null($customer))?'hide':''?>">
....
</div>

```

obviously your css would also need to define a class called `.hide` that had `display:hidden;` in it.
```
<div id="customerInfo" style="display:<?php echo (is_null($customer))?'none':'block'?>">

```

Take a look at css' [display](http://www.w3schools.com/cssref/pr_class_display.asp) and [visibility](http://www.w3schools.com/cssref/pr_class_visibility.asp) options