FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Form Cookie Question
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PHP Form Cookie Question [message #170093] Sun, 10 October 2010 02:25 Go to next message
jcage(at)lycos(dot)com is currently offline  jcage(at)lycos(dot)com
Messages: 2
Registered: October 2010
Karma: 0
Junior Member
Hello,

I have one form where a query is run based on the word placed into a
text box. The operator enters their name for example, on one form and
the query shows up on a second page. I'm using PHP, MySQL and Apache
and want the user to be able to click their browser back button and
not have to continuously re-enter their query word in the text box. I
know that some browsers allow this type of activity but in this case
and using Internet Explorer, that's not an option so...

Are there any good cookie scripts that will allow for this? Or is
there a better way of handling it?

TIA
Re: PHP Form Cookie Question [message #170094 is a reply to message #170093] Sun, 10 October 2010 02:32 Go to previous messageGo to next message
jcage(at)lycos(dot)com is currently offline  jcage(at)lycos(dot)com
Messages: 2
Registered: October 2010
Karma: 0
Junior Member
On Oct 9, 7:25 pm, "jc...@lycos.com" <jc...@lycos.com> wrote:
> Hello,
>
> I have one form where a query is run based on the word placed into a
> text box.  The operator enters their name for example, on one form and
> the query shows up on a second page.  I'm using PHP, MySQL and Apache
> and want the user to be able to click their browser back button and
> not have to continuously re-enter their query word in the text box.  I
> know that some browsers allow this type of activity but in this case
> and using Internet Explorer, that's not an option so...
>
> Are there any good cookie scripts that will allow for this?  Or is
> there a better way of handling it?
>
> TIA

I should mention too that my hope is, to find a cookie solution that
last for that single browser session only. thanks
Re: PHP Form Cookie Question [message #170095 is a reply to message #170093] Sun, 10 October 2010 02:32 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 10/9/2010 10:25 PM, jcage(at)lycos(dot)com wrote:
> Hello,
>
> I have one form where a query is run based on the word placed into a
> text box. The operator enters their name for example, on one form and
> the query shows up on a second page. I'm using PHP, MySQL and Apache
> and want the user to be able to click their browser back button and
> not have to continuously re-enter their query word in the text box. I
> know that some browsers allow this type of activity but in this case
> and using Internet Explorer, that's not an option so...
>
> Are there any good cookie scripts that will allow for this? Or is
> there a better way of handling it?
>
> TIA

What is a "cookie script"?

But no, you cannot do this reliably in PHP because when the user hits
the "back button", the browser may pull the page from its cache, and not
even go to the server. So no PHP code will ever be run.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: PHP Form Cookie Question [message #170096 is a reply to message #170094] Sun, 10 October 2010 02:38 Go to previous messageGo to next message
Michael Vilain is currently offline  Michael Vilain
Messages: 88
Registered: September 2010
Karma: 0
Member
In article
<bb1ce211-d5a3-43f6-8797-76a05e3ec73f(at)n16g2000vbg(dot)googlegroups(dot)com>,
"jcage(at)lycos(dot)com" <jcage(at)lycos(dot)com> wrote:

> On Oct 9, 7:25 pm, "jc...@lycos.com" <jc...@lycos.com> wrote:
>> Hello,
>>
>> I have one form where a query is run based on the word placed into a
>> text box.  The operator enters their name for example, on one form and
>> the query shows up on a second page.  I'm using PHP, MySQL and Apache
>> and want the user to be able to click their browser back button and
>> not have to continuously re-enter their query word in the text box.  I
>> know that some browsers allow this type of activity but in this case
>> and using Internet Explorer, that's not an option so...
>>
>> Are there any good cookie scripts that will allow for this?  Or is
>> there a better way of handling it?
>>
>> TIA
>
> I should mention too that my hope is, to find a cookie solution that
> last for that single browser session only. thanks

Use a JASON form where JAVASCRIPT is used with hidden fields. It will
break with people that disable JAVASCRIPT, so you'll have to decide if
your sub-optimal solution is "better" or having everything on one form
is an easier user experience. BTW, this isn't a php issue. It's
strictly a browser-based UI issue requiring HTML/JAVASCRIPT.

--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
Re: PHP Form Cookie Question [message #170098 is a reply to message #170094] Sun, 10 October 2010 09:09 Go to previous message
Geoff Berrow is currently offline  Geoff Berrow
Messages: 16
Registered: September 2010
Karma: 0
Junior Member
On Sat, 9 Oct 2010 19:32:07 -0700 (PDT), "jcage(at)lycos(dot)com"
<jcage(at)lycos(dot)com> wrote:

> On Oct 9, 7:25 pm, "jc...@lycos.com" <jc...@lycos.com> wrote:
>> Hello,
>>
>> I have one form where a query is run based on the word placed into a
>> text box.  The operator enters their name for example, on one form and
>> the query shows up on a second page.  I'm using PHP, MySQL and Apache
>> and want the user to be able to click their browser back button and
>> not have to continuously re-enter their query word in the text box.  I
>> know that some browsers allow this type of activity but in this case
>> and using Internet Explorer, that's not an option so...
>>
>> Are there any good cookie scripts that will allow for this?  Or is
>> there a better way of handling it?
>>
>> TIA
>
> I should mention too that my hope is, to find a cookie solution that
> last for that single browser session only. thanks

You should be able to implement a solution using session variables.
--
Geoff Berrow (Put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs www.4theweb.co.uk/rfdmaker
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Process queue without cron jobs
Next Topic: instructor solution manual for Electrical Machines, Drives and Power Systems (6th Ed., Theodore Wildi)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 05:06:51 GMT 2024

Total time taken to generate the page: 0.02919 seconds