Jump to content


Photo

Error emailing


  • Please log in to reply
5 replies to this topic

#1 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 July 2006 - 12:37 AM

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
"Syntax error" .. WHERE THE **** IS IT?!

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 28 July 2006 - 12:45 AM

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...
follow me on twitter @PHPsycho

#3 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 July 2006 - 12:46 AM

ill see if that works...
"Syntax error" .. WHERE THE **** IS IT?!

#4 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 28 July 2006 - 12:47 AM

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

<?php

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

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

?>

pg-2.php

<?php

$referer = $_GET[referer];

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

?>

PHP Ninja

#5 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 July 2006 - 01:05 AM

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!
"Syntax error" .. WHERE THE **** IS IT?!

#6 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 28 July 2006 - 01:08 AM

but toons code seems to work!
"Syntax error" .. WHERE THE **** IS IT?!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users