Page 1 of 1

PHP email form problem

Posted: Thu Jan 01, 2004 3:59 pm
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

Posted: Thu Jan 01, 2004 4:11 pm
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.