How can I use $HTTP_REFERER to check if the page was accessed from my domain. When I say domain, it could be a wild match as long as my .com is there?
Don't refer to $HTTP_REFERER (anyway the variable doesn't exist anymore, it is now $_SERVER['HTTP_REFERER') since more and more it is not sent and can be VERY EASILY hackable !!
You should use other stuff like sessions for example.
You could use a session var to do it instead.