Re: adding "Back to Search results" link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the help, Kirk.

The form 2 uses a _GET to call the information from Form 1.

So you select the serach criteria on Form 1, Form 2 returns the criteria, 
Form 3 is the result of a selection made on Form 2.  And for some reason I 
can't pass that Query String from Form 1 into Form 3.

I am still having problems passing the string. But only because at the point 
a user reaches form 1 the Session is already active. Maybe I am just placing 
the

 $_SESSION['search_results_querystring'] = $_SERVER['QUERY_STRING'];

in the wrong place. I assume this has to be placed before right after my 
include statements.

I am still messing around with it. I have also been told that maybe passing 
the value as a part of the (already established) cookie may work as well. 
Both options seem to use the same logic.

I'll keep you posted.


""Kirk Friggstad"" <kirk@xxxxxxxxxxxxxx> wrote in message 
news:ac238df10708151506q143b65ewa8e57bdb5792f27e@xxxxxxxxxxxxxxxxx
> Derek:
>
> Does "form 1" use POST or GET to call "form 2"? If it uses GET, you
> could store the search page URL  in a $_SESSION variable - something
> like this in your search results (form 2):
>
> $_SESSION['search_results_querystring'] = $_SERVER['QUERY_STRING'];
>
> and in your editing page (form 3):
>
> <a href="form2.php?<?php echo $_SESSION['search_results_URL'] ?>">Back
> to search results</a>
>
> (You'll need session support in both pages, of course - make sure you
> call session_start() before working with the $_SESSION array).
>
> If "form 1" uses POST, then it'll get a little more complicated - you
> could try saving the $_POST data in the session (think there was a
> recent thread on this list regarding that) and creating a form with
> hidden elements on "form 3" that does a POST back to "form 2".
>
> I'm a bit of a PHP newbie myself (just coming out of a long career in
> ASP/VBscript development), so I'd appreciate any comments, (gentle)
> criticism, etc. Hope this helps.
>
> Kirk
>
> On 8/15/07, Derek <dmoon3@xxxxxxxxxx> wrote:
>> Jim and Brad.
>>
>> Thanks for the feedback. I was thinking it was something simple like a 
>> back
>> button. But the problem that arises when I use this method is on Form 3.
>>
>> If I go through the steps, and make a change to an item on Form 3. Then 
>> use
>> the <a href="javascript:history.go(-2);">Return to search
>> results</a>.....everything works fine.
>> But if I dont make any changes to Form 3. then this takes me all the way
>> back to the search page.
>>
>> People in my group use this form to update database information for a 
>> number
>> of items. Once they make changes, they would like to go back to the 
>> search
>> results, instead of having to run the same search again and again.
>>
>>
>>
>>
>> "Jim Lucas" <lists@xxxxxxxxx> wrote in message
>> news:46C361B8.8040604@xxxxxxxxxxxx
>> > Derek Moon wrote:
>> >> I am trying to imporve a web application that my group uses.
>> >>
>> >> Basically there are 3 forms that work together Form 1 > form 2
>> >>
>> >> Form 1 - searchs for enterend values
>> >> Form 2 - returns search results, letting you individually select any 
>> >> item
>> >> Form 3 - lets you edit a specific individual item
>> >>
>> >> I want to make a link on the Form 3 that returns you to form Form 2
>> >> basically a "Back to Search results" link.
>> >>
>> >> I'm thinking that there is a way to pass the query string, but I am a
>> >> newbie and I'm not sure that I am going about this the right way.
>> >>
>> >> Anyone have any advice or knowledge to share? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux