Global variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tuta
Forum Newbie
Posts: 21
Joined: Mon Jun 30, 2003 3:37 pm
Location: Brasil

Global variable

Post 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.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post 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
tuta
Forum Newbie
Posts: 21
Joined: Mon Jun 30, 2003 3:37 pm
Location: Brasil

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

because I need read a variable in other php out of sequence
please, can you explain this in more detail?
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post 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.
Post Reply