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
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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.