Passing vars...

Passing vars...

am 03.04.2008 21:15:51 von FB

I have a question about passing variables around pages...

I have a line in my HTML that passes a variable to the $_POST. It looks
like this:


Somewhere above this HTML script is some code that sucks the value out
of the $_POST. It looks like this:
$processTF = $_POST['process'];

On that same page, I do some stuff that changes the variable "processTF"
from "true" to "false". It looks like this:
$processTF = "false";

I then put that variable back into $_POST like so...
$_POST['process'] = $processTF;

Now, this page bounces to another page. I have to move this new value
to that page, so that I can use it in some more code...On the other page
I tried to do this:

$process=$_POST['process'];

But it still contained true. It wasn't changed. Is there another way
of changing or passing this new information?

fb

Re: Passing vars...

am 03.04.2008 21:22:24 von Courtney

fb wrote:
> I have a question about passing variables around pages...
>
> I have a line in my HTML that passes a variable to the $_POST. It looks
> like this:
>
>
> Somewhere above this HTML script is some code that sucks the value out
> of the $_POST. It looks like this:
> $processTF = $_POST['process'];
>
> On that same page, I do some stuff that changes the variable "processTF"
> from "true" to "false". It looks like this:
> $processTF = "false";
>
> I then put that variable back into $_POST like so...
> $_POST['process'] = $processTF;
>
> Now, this page bounces to another page. I have to move this new value
> to that page, so that I can use it in some more code...On the other page
> I tried to do this:
>
> $process=$_POST['process'];
>
> But it still contained true. It wasn't changed. Is there another way
> of changing or passing this new information?
>
> fb

try

if $processTF=="false"
{
?>

else
?>

Re: Passing vars...

am 03.04.2008 22:48:39 von unknown

Post removed (X-No-Archive: yes)

Re: Passing vars...

am 04.04.2008 14:11:37 von colin.mckinnon

On 3 Apr, 20:15, fb wrote:

> I then put that variable back into $_POST like so...
> $_POST['process'] = $processTF;
>
> Now, this page bounces to another page.

What does that mean? You redirect? If so this a new request and the
GET and POST variables will be lost. You need to either put the POST
vars into the query part of the destination and pick them up as GET
vars or store them in the session.

C.