RE: [PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

Thanks Martin. I will try that.

Claude Cormier
Ormetal Inc.

http://www.goldcurrencies.ca
http://www.ormetal.com
=
Claude Cormier Public Key
http://www.ormetal.com/keys/ClaudeCormier.asc
=

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




RE: [PHP] How to clear variables?

2002-03-21 Thread Martin Towell

I think he means using header() - look in the manual, there's a snippet of
code you can copy-and-paste that does cache control

Martin

-Original Message-
From: C. Cormier - Ormetal Inc. [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 9:06 AM
To: Rasmus Lerdorf; [EMAIL PROTECTED]
Subject: Re: [PHP] How to clear variables?


On 21 Mar 2002, at 8:33, Rasmus Lerdorf wrote:

> Well, you could prevent the user from cacheing the page by sending the
> appropriate cache control headers.  Then when they click back it would
> say that the page is expired.

Hello Rasmus,

I tried what you suggest with:

session_cache_limiter('nocache');

But it does not work. The page and variables remain cached. Is 
that what you had in mine or is it something else ?

Claude
Ormetal Inc


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

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




Re: [PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

On 21 Mar 2002, at 8:33, Rasmus Lerdorf wrote:

> Well, you could prevent the user from cacheing the page by sending the
> appropriate cache control headers.  Then when they click back it would
> say that the page is expired.

Hello Rasmus,

I tried what you suggest with:

session_cache_limiter('nocache');

But it does not work. The page and variables remain cached. Is 
that what you had in mine or is it something else ?

Claude
Ormetal Inc


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




Re: [PHP] How to clear variables?

2002-03-21 Thread Rasmus Lerdorf

> On 21 Mar 2002, at 8:03, Rasmus Lerdorf wrote:
>
> > This Faction variable comes from the browser.
>
> Thanks for answering Rasmus.
>
> But is it possible to clear this variable. Is this what is called a
> global variable? If not, does this means that the scope of POST
> variables is as long as the life of the browser session ?

No, you are misunderstanding the issue.  It's like asking if you can clear
the URL in someone's browser so that when they hit reload they will not
reload your site.  You can't control their browser like that from PHP.
That is purely a client-side issue.  You might be able to do some funky
Javascript to do it, but from a PHP perspective it is out of your hands.
You simply have to compensate in your server code to avoid committing the
same query twice.

>  the post so a reload wouldn't reload the posted page.>
>
> Sure. But the user can always click "Back" on the browser and
> reload all data?

Well, you could prevent the user from cacheing the page by sending the
appropriate cache control headers.  Then when they click back it would say
that the page is expired.

-Rasmus


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




Re: [PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

Thanks for your help.

> Well, you could prevent the user from cacheing the page by sending the
> appropriate cache control headers.  Then when they click back it would
> say that the page is expired.


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




Re: [PHP] How to clear variables?

2002-03-21 Thread C. Cormier - Ormetal Inc.

On 21 Mar 2002, at 8:03, Rasmus Lerdorf wrote:

> This Faction variable comes from the browser.

Thanks for answering Rasmus.

But is it possible to clear this variable. Is this what is called a 
global variable? If not, does this means that the scope of POST 
variables is as long as the life of the browser session ?



Sure. But the user can always click "Back" on the browser and 
reload all data?


Claude
Ormetal Inc.

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




Re: [PHP] How to clear variables?

2002-03-21 Thread Rasmus Lerdorf

> The above speudo script work fine and when the user click 'Add to
> Data', the data is added to my database.  Howver, the
> session_unregister and session_destroy do not clear the variable
> Faction and its value. Therefore if the user click Reload on the
> browser, the data gets added again.
>
> What is my problem,

Uh...  Do you actually do a session_register('Faction')?  If so, why?  I
bet you don't though, which means your question has nothing to do with
sessions.  You can't prevent a user from hitting reload and re-posting the
same data.  This Faction variable comes from the browser.  You simply have
to check to see if the data has already been added to your database and
not allow the re-post.  Or redirect away from this page as soon as you get
the post so a reload wouldn't reload the posted page.

-Rasmus


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