Jump to content

[SOLVED] posting/referring(?) page help


simon551

Recommended Posts

Trying to simplify my data entry workflow a little bit. (too many pages to update)

 

I have a page that submits info through a form. (form 1)

The processing script is in another file. (script 1)

  script 1 sends the user back to form 1 for more entries

 

Then there is a page to review entries (report 1)

  with a link to edit ---> (form 2)

  The processing for form 2 is another file (script 2)

    script 2 sends the user back to report 1 after the submit on form 2

 

also on form 1 is an a list of entries for this master record. (growing after each submit)

  on this detail is a link to edit the entry (currently form 3, but what I'm trying to do next will allow me to point it to form 2)...

 

What I would like to do is have the same page for editing but use a little logic of where they got to the edit page from so that the user will be sent back either to the data entry page or the report page depending on which page they started at. NOT to the edit record page which is where the $_POST will be coming from.

 

 

 

Link to comment
Share on other sites

I notice no-one has replied.. I think they are as baffled as I am by your explanation.

 

Can you give some details about your application?  Not that I need to know, but it's hard to understand it in such an abstract form.

 

You can even post your scripts if you want (in code tags).  Sometimes programmers find code easier to understand than english :)

Link to comment
Share on other sites

hi, yeah. This is an intranet application site. Currently I'm working on an expense report section of the site.

 

The data entry page is for detail records for an expense report. I'm trying to make it a little easier for the users by showing a list of entries as they enter records. Then on that list is a link to edit the record.

 

There is also a report page that is a printable detail of all the entries in the report. Something they can also turn in to accounting with all the receipts. I'm also providing a link on the report for editing records.

 

what I'd like to do is to use the same form for editing whether the user is coming from the data entry page or the report page-- and then direct back -- after submitting the edited record -- to the page they were on.

 

somehow I guess I would like to store a variable, maybe a $_SESSION[referer] type of variable, if that's possible, on the editing page and then pass it to the processing page to write into this part of the processing page:

header("Location: ". $er);

 

sorry about all the typos

 

Link to comment
Share on other sites

Ok, that makes sense.  And sessions sounds like a good solution.

 

Is there any problem with storing the url to return to in $_SESSION and redirecting back?  As an alternative to Location, you can use a meta refresh tag with a delay.  That lets the user see the results of what they did before getting redirected.

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.