PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Is there a way in PHP to sense if the user typed something into the URL bar instead of clicking a link? A friend of mine who uses ASP gave me this code that he uses, but I know nothing about ASP.
If Left(Request.ServerVariables("e;HTTP_REFERER"e;), Len(GameRootURL)) <> GameRootURL And Left(Request.ServerVariables("e;HTTP_REFERER"e;), Len(GameRootURL2)) <> GameRootURL2 Then
if ($SERVER[HTTP_REFERER]=="") { //THE user typed the url
However:
'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.