Jump to content

Archived

This topic is now archived and is closed to further replies.

legohead6

Error emailing

Recommended Posts

Hi, I recently redid my homepage and merged it with a secondary homepage! but the problem is the the site is so big im not going to go through everypage redoing the links so they work so i have made the secondary hompage just a message that says youve come here by mistake please click here! but when they click i want it to email me and tell me the page they came from(javascript probably) but i dont know how to find the previous page...

EDIT: AUTOmaticly too :P (without them entering anything!) then it takes them to index.php

Share this post


Link to post
Share on other sites
you can use $_SERVER[HTTP_REFERER'] to get the url of the last page but this is not always sent by the client!

you could indeed use js - not knwoing the answer but imagine it would be something to do with the history object....

sure someone will enlighten us both on that one though...

Share this post


Link to post
Share on other sites
Your post is a bit vague? Why would links throughout your site stop working? Why would you have to change them globally? Are you using relative paths to files on your server? Are you using static HTML pages or PHP pages?

Also:

pg-1.php

[code]<?php

$refpage = $_SERVER[HTTP_HOST].$_SERVER[REDIRECT_URL];

echo"
<a href=\"page2.php?referer=$refpage\">Click Here</a>";

?>[/code]

pg-2.php

[code]<?php

$referer = $_GET[referer];

//Now you can take that value and either email it, or throw it into a table in your db.

?>[/code]

Share this post


Link to post
Share on other sites
well before my index(index.php) was a login page and you had to login to get to the acual index(home.php)! now ive made the accualy index(home.php) the only index (index.php)and put a login box on it but i know there are still some pages i havent changed that link to home.php witch is the old successful login page! so thats what i was doing making home.php email me if a user gets there and from where he got there so i can go in and change the link!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.