Page 1 of 1

Global variable

Posted: Thu Oct 02, 2003 11:03 am
by tuta
Hi!
I have a form field with type text in my html page.
This is the fielt to get user code in my php code.
My problem is what i do to create a public variable with php, because I need read a variable in other php out of sequence.

Posted: Thu Oct 02, 2003 11:14 am
by BDKR
Hi tuta,

I am not sure that I understand. You want to take user input from a form and pass some of that data to a program running in C?

If that's the case, doesn't that var exist in one of the super global arrays? Like $_GET or $_POST?

After that, it should be no big deal to pass the var to a prog running in C.

Cheers,
BDKR

Posted: Thu Oct 02, 2003 11:19 am
by tuta
I´m using $_POST and form action="name.php?var=...".
In the first php code i can see the variable, but in others php code i can´t see the variable.
Thank´s

Posted: Thu Oct 02, 2003 12:08 pm
by volka
because I need read a variable in other php out of sequence
please, can you explain this in more detail?

Posted: Thu Oct 02, 2003 12:49 pm
by mrvanjohnson
Yeah I'm not really following your problem either.

but, if you are trying to access the variables on other pages, you need to make sure you are still passing the variables from page to page. Just because you have a $something = $_POST[something]; doesn't mean that $something is always there for you if you leave the page.