Jump to content

Error emailing


legohead6

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
Link to comment
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...
Link to comment
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]
Link to comment
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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.