Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cant figure how to create link to previous page


rumi

Recommended Posts

Posted

Im trying to add a Back Button on some of my pages. I took this line of code from my address_book.php and changed the filename from FILENAME_ACCOUNT to DEFAULT, thinking it may default back to the last page viewed, but it links back to index.php instead. Does anyone know how I can link back to the previous page?

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'SSL') . '">' .

tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?>

 

Thank You

Posted

Put this code at where you want the Back button:

<?php	$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
?>
			<td align="center"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<?php
}
?>

 

chnage the align="" to left or right as per your need.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Posted
Put this code at where you want the Back button:

<?php	$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
?>
			<td align="center"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<?php
}
?>

 

chnage the align="" to left or right as per your need.

 

Ken

THANK YOU KEN!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...