PHP email form problem

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
soon
Forum Newbie
Posts: 2
Joined: Thu Jan 01, 2004 3:59 pm
Location: Derby UK

PHP email form problem

Post by soon »

Hi

I've got a very useful PHP email script - http://www.gospelcom.net/guide/resources/formcode.phps

to which I would like to add the ability for the email to me from site visitors, to include the URL of the referring page they came from. This puts their email in context so it makes more sense.

I have tried all sorts of things on the recommendation of friends, but because the page is essentially three pages in one, it always gives its own URL as the referrer.

If anyone can see a way of doing this - even it is just to drop the URL visibly into the text area, I'd be very grateful.

Thanks

Tony
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Depending on how we cant see how your page(s) actually work (including pages? switch()'ing function being used? etc.), you need to tweak this around yourself abit...

Code: Select all

echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
echo __FILE__;
echo basename(__FILE__);
...might be something worthlooking more into. Do a phpinfo() and check the $_SERVER variables at the bottom of that page, to find out more useful things.
Post Reply