hi everyone...im having an issue with collecting the data using HTTP_REFERER

the problem is if i paste or type a referral url into the url bar it gives an error :-
Message: Undefined index: HTTP_REFERER

but if i click the link from another site it works perfect...

i understand that the error is because ts looking for a url of where the link came from, and if i pasted it, then there isnt a refferal url

but how would i write a code that will bypass this?

im thinking it would be a if/else command but i cant seem to get anything to work!

i need somethin that will say "if site url exists then collect data otherwise goto website normally"

any ideas please??

Recommended Answers

All 2 Replies

Member Avatar for diafol
if(isset($_SERVER['HTTP_REFERER']))....

excellent thank you...i was missing the isset command haha i cant beleive i overlooked that

thanks very much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.