I need to weed out the url retrieved by http_referer, I don't care what page they came from just what the main site is. They will have reps coming to our site and each will have a diff. xxx.htm and I just need to verify the main site??? Thanks
Did you mean you only want the domain?And not the whole url? If my guess's correct, perhaps this is what you wanted.
$test=explode($the_url,"/"); $domain=$test[0];
correct, am I replacing $the_url or $domain with a actual url??
$the_url = $_SERVER['HTTP_REFERER']; $parts = explode($the_url,"/"); $domain=$parts[0];
Is that clearer?
Have you tried the parse_url function?
http://us2.php.net/manual/en/function.parse-url.php
Originally posted by BuzzLY $the_url = $_SERVER['HTTP_REFERER']; $parts = explode($the_url,"/"); $domain=$parts[0]; Is that clearer? [/B]
Originally posted by BuzzLY
Is that clearer? [/B]
Kinda, I am missing something though, I can't get the url to to print ot the page without the extention. What am I missing? Or what else do I need?