I am having a problem trying to code a while statement into my PHP script.
I am using PHP-3.0.16.
I have created a PHP script to process up to 15 parameters to extract data from a LDAP database input via a HTML form.
I have the following code :-
<?php function process_form()
global $(the other 14 parameters)
while (list($key,$value = each (HTTP_POST_Vars))
$PARAM is processed using ldap_search.
If the script is as above, I get details from the LDAP database, but my blank form displays the warning
Variable passed to each() is not an array or object in /www/htdocs/php/seznam2.php3 on line 119. (line 119 is the while command).
If I include the while statement within the process_form function, my blank form is what I want to see ( ie without the warning), but
when I process the form I do not get anything back from the LDAP database and have the warning printed.
I have tried putting the while statement in its own function statement with the same result. The problem is that the HTTP_POST_VARS are not passed to the while statement.
Can anyone please let me know how to overcome this problem.