Hi!
$_SERVER['HTTP_REFERER'] will show where it came from, but i dont say it`s a secure way to check this.
To do this secure you shold do this:
- Generate a uniqe key when a user visit your page.
- Save the key to database or file.
- Put the key in an <input type="hidden" name="validationKey" value="<?php echo $key;?>"> in the form
- When a user submit the form check the $_POST['validationKey'] against the saved value.
You will find plenty articles about this on the web.