[PHP] preserving variable values across pages.

2002-02-11 Thread Andrew Slezak

Found this on the php.net, querying the PHP mailing list:

">test.php
--
$blah=10;
include "whatever.php";


>whatever.php
-
echo "The value of blah is: {$blah}";


It just keeps the variable since it's global..

When ur using a function. It can be different, since you have to
import these variables."


HTH,
Andy
- Original Message -
From: "Tehn Yit Chin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 1:22 AM
Subject: [PHP] preserving variable values across pages.


> Hi all,
>
> If I have the following code,
>
>  global $some_var
> 
> type="submit" name="submit" value="foobar">
> 
> ?>
>
>
> When the user hits the submit button, the value in some_var disappears? Is
> there a way of perserving the value in $some_var.
>
> thanks in advance.
>
> cheers,
> Tehn Yit
>
>
> --
> 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




[PHP] dynamic pulldown list generation help

2002-02-26 Thread Andrew Slezak

Basically I am setting ls > array().  I want each item to be an option in
the array.  I have have scoured for some time now and this is what I have
come up with, but it is not populating each file as an ?  The select
box is just empty.  I know this is an array because I have tested with
print_r.  Stuck!

Can someone tell me what I am doing wrong?

";
echo "";
function generate_option_list($arr1, $set) {
reset($arr1);
while (list($key,$value) = each($arr1) ) {
{$var.="$value";}
} return $var;
}

echo "";

?>

TIA,
Andy


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