If statement

3 posts by 2 authors in: Forums > CMS Builder
Last Post: November 6, 2008   (RSS)

Re: [chassa2556] If statement

By Dave - November 6, 2008

Hi chassa2556,

From a user interface point of view it's better to have consistent navigation elements on a page. It's confusing for users if sometimes a link is there and sometimes it's not because they may not realize the reason.

One solution is to use a javascript link to go to the previous page they were on such as:

<A HREF="javascript:history.go(-1)">Go to previous page</A>

You could also use PHP to send them to the referer page:

<A HREF="<?php echo @$_SERVER['HTTP_REFERER'] ?>">Go to previous page</A>

To not show the link when you came from the index page you'd need to test the referer value for something unique that wasn't on the other pages. Such as (if referer contains "index.php" or something like that). The first step is to identify what you're going to test for to determine if the link should be shown or not.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] If statement

By chassa2556 - November 6, 2008

Great that php a href did the job just grand thanks