If a variable's value is empty...
Posted: Mon Jun 08, 2009 12:08 pm
I've inherited some code that uses urchin to store things in the database. The following gets the data:
and then later $getVar is used to form the URL string:
I want the code to leave the utm_source, utm_medium and utm_campaign off of the URL if the variables are empty.
What is the easiest way to do that?
Thanks!
Code: Select all
$getVar = "?utm_source=".@$_REQUEST["utm_source"]."&utm_medium=".@$_REQUEST["utm_medium"]."&utm_campaign=".@$_REQUEST["utm_campaign"];Code: Select all
$strBlocks .= "<a href='blocks.php".$getVar."&pg=1'><span class='paginator'>First</span></a> ";What is the easiest way to do that?
Thanks!