Preventing links to make history

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
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Preventing links to make history

Post by Syranide »

Hmm, I guess this doesn't entirely apply to the PHP section, but I figure that the peoplein the PHP section should know of this better than in the HTML section.

So, what I want is simply, I want to be able to send links by email to people, but when they are clicked, they should not be stored in history... however, I've looked through all the headers and didn't see anything really applicable.

The only thing that came to my mind is to respond with 404 but still output a page, as the browser would take it to be incorrect and not store it, however, I also know that this could be quite troublesome to some browsers as some fancy their own error pages more (and really defies the purpose with 404).

Does anyone know if there is another (better) way to force an URL not to be stored in the history?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

similar thing asked here viewtopic.php?t=37345

not possible
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

some were suggesting that location.replace can replace the existing href which might erase the existing location.href value....subsequently means overwriting the last url copied to the history object
they did something like this...

Code: Select all

<A HREF="newPage.html" ONCLICK="location.replace(this.href); return false;"  >new page</A>
Post Reply