Web Hosting Talk







View Full Version : php question


tuvok
04-18-2002, 05:43 AM
high guys

I am trying to write a small little script that will check the refer id on a url and write it to a database, i have it all igured except for one bit, if the referer value is nothing, i want the scrpt to create a new value for it e.g

http://www.mysite.com/index.php?ref=


<? if($ref=="") { ?>

at this point, if $ref = nothing then i want to give it a value "direct-hit"

so that i can track direct visitors and refered ones

what will the full line of code look like to give $ref this "direct-hit" value.

thanx

AddSupport
04-18-2002, 06:06 AM
I think this is what you want.
<?
if ($ref == "") {
$ref = 'direct-hit';
}
?>