Suppose I have a registration page in my website that contains a registration form:
After submitting the form, the request goes to a php page. In that page you use the below code to check if its coming from your domain:
if(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) == "yourdomain.com") {
//process the request
} else {
echo "Sorry";
}
EDIT: Agree. This is not secure. Just a bad hack