Jump to content

go back to original point on page


jeff5656

Recommended Posts

Inside a while loop, I have a different record, with a unique id.  So I want to process a script and have it return to that same position.  I realize I need to name it first:

 

<a name="foo" href="newbundle.php?action=edit&id=<?php
 echo $row['id_incr']; ?>">click here to process</a>

 

I know I need to put this in to return:

header("Location: ../../mc/displayactive.php#foo");

 

But how do I have it return that specific record that the user had originally clicked?

Link to comment
https://forums.phpfreaks.com/topic/155378-go-back-to-original-point-on-page/
Share on other sites

Suggest that you use something like this:

<a id="foo<?php echo $row['id_incr']; ?>" href="newbundle.php?action=edit&id=<?php echo $row['id_incr']; ?>">click here to process</a>

 

Then you can just redirect to URL#foo<?php echo $row['id_incr']; ?>

 

EDIT: To confirm, you shouldn't just use $row['id_incr'] as the link id as id's must not begin with a number to be valid xhtml. Doesn't have to be "foo" obviously, name it something short and relevant, just a single letter before the numbers is fine.

 

 

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.