Goto specific page, back, or forward

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

patrickd123
New php-forum User
New php-forum User
Posts: 6
Joined: Fri Oct 28, 2005 5:43 am

Goto specific page, back, or forward

Postby patrickd123 » Sun Oct 30, 2005 1:24 pm

Hi,

How do I code:

1- Go Back (like the browser's back button)
2- Go forward (like the browser's forward button)

Thanks

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Sun Oct 30, 2005 4:31 pm

Code: Select all

<!-- Going back -->

<a href="javascript:history.go(-1)">Back</a>
<!-- Or -->
<a href="javascript:history.back()">Back</a>

<!-- Going forward -->

<a href="javascript:history.go(+1)">Forward</a>
<!-- Or -->
<a href="javascript:history.forward()">Forward</a>

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Sun Oct 30, 2005 5:09 pm

Note: Topic moved to "HTML Basics"!

patrickd123
New php-forum User
New php-forum User
Posts: 6
Joined: Fri Oct 28, 2005 5:43 am

Postby patrickd123 » Mon Oct 31, 2005 8:25 am

That, I knew. It puts a link to previous and next page. But I don't want to put a link. I want to be able to change the page by the PHP script, so the user doesn't have to click on the link.

Is that doable?

Thanks

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Tue Nov 01, 2005 7:31 am

u can't ask php to do that, you will have to use the header function for that.
or use the META tag with http-equiv


Return to “HTML Basics”

Who is online

Users browsing this forum: No registered users and 2 guests

cron