How do I make Arrays global? Let's say:
function someFunction() { <FORM ACTION="action.php" METHOD="POST"> <INPUT TYPE="text" NAME=Array[StudentName]> </FORM> } function someOtherFunction() { That will in some way make use of Array[StudentName] }
How do I make the Array[StudentName] global?
To answer your question, use the global keyword.
function someOtherFunction() { global $StudentNames; /* Use the student name information */ } $StudentNames = $_POST['StudentNames'];
I'll assume you know that your someFunction() has many problems.
hey dude, well all i can say is that it would probably be better if u assigned the array position to a variable and then just put your
register_globals = On
in your php.ini file, dont see why that shouldnt work lata
actually, even simpler might be to use the $_POST['StudentNames'] array within the function directly.