This topic is locked

returning to a previous page

2/12/2008 7:02:25 PM
PHPRunner General questions
H
horsey_kim author

I need help getting a screen to return to previous screen.
Currently the user goes to the detail_list.php page (as an example we will pretend the page is detail_list.php?mastertable=cblue&masterkey1=50) They are looking up all the lots associatied to the master -detail relationship of invoice #50
On this page (thanks to Jane's help) I have a button that says "select lots", when you click it, you are sent to another page (lets say it is called pickblue_list.php) that shows a list of items that can be added to that invoice. When they select the items they want and then click a button that was created for updating the records with the master invoice number. Then the screen goes refreshes and we see the pickblue_list.phpscreen.
WHAT I want instead of the pickblue_list screen is for the previous detail_list.php to show up. I know how to do a redirect. BUT I don't want it to just redirect back to that page, I needed it to redirect to the page and include the condition in the url for the mastertable and masterkey1 values too. So it actually goes back to the previous page.
I hope this is clear. HELP <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7543&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

J
Jane 2/13/2008

Hi,
try to redirect to the detail_list.php?a=return page.

H
horsey_kim author 2/14/2008

It does not retain the masterkey1 value. Isn't there any code that will allow the masterkey1 value to be retained?
It drops the masterkey1 value and does not go back to the previous Master_detail page correctly.
Kim

H
horsey_kim author 2/14/2008

Oh I might have a solution - working on it with $_session - I am still open to ideas in case this one does not work.
Kim <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=25909&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

H
horsey_kim author 2/15/2008

The problem I was having was because when I left the first page to go to the second page, it would lose the masterkey1 value.
But this is how I got around it:
Example:
first page is detail_list.php (master_detail list page)

second page pickblue_list.php (where I wanted to find lots and after I finish return back to the first page)
I decided to create a button to match the other add, edit and such buttons that the user could click when they were done and it take them back to the exact master detail page called detail_list.php
In the event section I inserted this code under the ListOnLoad for the detail page: (custom code)
$_SESSION['mywhy'] = $_REQUEST["masterkey1"];
On the second page pickblue.php from the visual editor I inserted "php code snippet", but made sure it is inserted above this tag <!-- delete form --> - in my case I had to insert it BEFORE the <form> code that was above the <!--delete form--> tag. I am using the Paris template
echo "<SPAN class=buttonborder><INPUT class=button onclick=\"window.location = 'detail_list.php?a=return&masterkey1=".$_SESSION["mywhy"]."'\" type=button value=\"Return to PICKBLUE\"></SPAN>";