Click to See Complete Forum and Search --> : Http Referrer


peps666
08-18-2003, 04:18 PM
I'm kind of a beginener in Java Scrpit programmation.

When people register in my web page, once they are finished they go back to the main page. I would like them to go back to the page they were BEFORE registering. To do that, you have to tell the browser to go back two times. I don't know how to do that.

To go back one page i use that command:
$urlaa = $HTTP_REFERER -();
print("<html>
<head>
<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=$urlaa\">
</head>

How do you do it for two times back?
Thanks

pyro
08-18-2003, 04:41 PM
This will only work for uses with javascript enabled. For those without, it will send them to an index page:

<a href="index.php" onclick="history.go(-2); return false;">Go Back</a>

peps666
08-27-2003, 03:07 PM
Thank you for your answer. Your script indeed work but it wasn't exactly what i was looking for.

By using this script the user has to click a button before going back two times. Me, I would like the redirect to be automatic after 1 second.

Any idea?

pyro
08-27-2003, 03:13 PM
untested:

<script type="text/javascript">
function goBack() {
history.go(-2);
}
setTimout("goBack()",1000);
</script>

webrik
09-08-2006, 11:01 PM
This will only work for uses with javascript enabled. For those without, it will send them to an index page:

<a href="index.php" onclick="history.go(-2); return false;">Go Back</a>

Just in case anyone should search for this answer.

I was using the history.go(-1) or history.back() to let my users go back one page. This was working in IE 6 and Opera 8.5 but NOT in Firefox 1.5.

While searching for an answer in this forum, I noticed this thread and return false in this message.

I added the return false; to the onclick event, and now this is working in Firefox too.

Thanks ...

Please let me know if this message helps you too. Just want to know if someone else found this to be a problem.