Forum
PHP help: echo if exists
I have the following heading code on my results page for a filterable form.
<h1 class="smallh1">Search results:
<span class="pink"><?php echo perch_get('type'); ?></span>
<span class="pink"><?php echo perch_get('location'); ?></span>
</h1>
What code would I use If the user does not select anything in the 'type' select box. Ideally I would want it to echo "Any type in Location name"
How can I make it echo the words Any Type if nothing is selected .
Any help is appreciated.
Hi, I think you could use something like:
Thanks Simon,
This throws up the following error though
Hi, I missed a php tag. I think this should do it:
Perfect, thanks Simons.
This is the code I have ended up using based on your initial code: