By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

getting variables from one page to the other

P: n/a
Hello, I am new to PHP and I have the following problem.

In one php page I define some variables $teller, $budget. Also I ask for
some input from the user:

<FORM ACTION="resultaat.php" METHOD=POST>
<INPUT TYPE="Text" NAME="gemaakt" MAXLENGTH=3 SIZE=4 VALUE="0">
<INPUT TYPE="Text" NAME="verwacht" MAXLENGTH=3 SIZE=4 VALUE="0">
etc.

Now that I posted the input, resultaat.php is started. I can get the
variables $_POST["gemaakt"] and $_POST["verwacht"] but not $teller and
$budget.

Now I know that has to do with the setting register_globals that is set
off. That is for safety okay, my question:

Is there a safe way to get the variables $teller and $budget also usable
/known in resultaat.php without putting register_globals on?

I tried (being a newby) $_GET["teller'] but that did not work.

Thanks in advance, Edward

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"edward hage" <ed**@xs4all.nl> wrote in message
news:3f*********************@news.xs4all.nl...
Hello, I am new to PHP and I have the following problem.

In one php page I define some variables $teller, $budget. Also I ask for
some input from the user:

<FORM ACTION="resultaat.php" METHOD=POST>
<INPUT TYPE="Text" NAME="gemaakt" MAXLENGTH=3 SIZE=4 VALUE="0">
<INPUT TYPE="Text" NAME="verwacht" MAXLENGTH=3 SIZE=4 VALUE="0">
etc.

Now that I posted the input, resultaat.php is started. I can get the
variables $_POST["gemaakt"] and $_POST["verwacht"] but not $teller and
$budget.

Now I know that has to do with the setting register_globals that is set
off. That is for safety okay, my question:

Is there a safe way to get the variables $teller and $budget also usable
/known in resultaat.php without putting register_globals on?

I tried (being a newby) $_GET["teller'] but that did not work.

Thanks in advance, Edward

Yep, with sessions.

--
Sharif Tanvir Karim
http://www.onlyonxbox.net
Jul 17 '05 #2

P: n/a
If they're not sensitive, put them into the form as hidden fields and then
you should be able to get them through $_POST.

Peter.

"Sharif Tanvir Karim" <sh****@nyc.rr.com> wrote in message
news:bD********************@twister.nyc.rr.com...
"edward hage" <ed**@xs4all.nl> wrote in message
news:3f*********************@news.xs4all.nl...
Hello, I am new to PHP and I have the following problem.

In one php page I define some variables $teller, $budget. Also I ask for
some input from the user:

<FORM ACTION="resultaat.php" METHOD=POST>
<INPUT TYPE="Text" NAME="gemaakt" MAXLENGTH=3 SIZE=4 VALUE="0">
<INPUT TYPE="Text" NAME="verwacht" MAXLENGTH=3 SIZE=4 VALUE="0">
etc.

Now that I posted the input, resultaat.php is started. I can get the
variables $_POST["gemaakt"] and $_POST["verwacht"] but not $teller and
$budget.

Now I know that has to do with the setting register_globals that is set
off. That is for safety okay, my question:

Is there a safe way to get the variables $teller and $budget also usable
/known in resultaat.php without putting register_globals on?

I tried (being a newby) $_GET["teller'] but that did not work.

Thanks in advance, Edward

Yep, with sessions.

--
Sharif Tanvir Karim
http://www.onlyonxbox.net

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.