Check the domain on which the form is - before sending

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!

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

Check the domain on which the form is - before sending

Post by Calimero »

The topic may be ambiguos so in details:

I have page2.php to which I'm submiting my form from the page1.php.


Now what I would like to know is:

What is the best ( most efficient way ) to check whether the page that submits the data to my page2.php is from the same server ( do I use localhost or maybe for ex. abcdefg.net ) and from the particular directory and specific page/file name?

I need this because I use this submit ( dock ) page with several forms, and input types, names, number of fields vary...

Thanks Ahead !
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

when in doubt,

do a:

Code: Select all

echo '<pre>'; print_r($_SERVER); echo '</pre>';
Post Reply