getting variables from one page to the other

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • edward hage

    getting variables from one page to the other

    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="resulta at.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_global s 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_global s on?

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

    Thanks in advance, Edward

  • Sharif Tanvir Karim

    #2
    Re: getting variables from one page to the other

    "edward hage" <edha@xs4all.nl > wrote in message
    news:3fd2658a$0 $211$e4fe514c@n ews.xs4all.nl.. .[color=blue]
    > 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="resulta at.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_global s 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_global s on?
    >
    > I tried (being a newby) $_GET["teller'] but that did not work.
    >
    > Thanks in advance, Edward
    >[/color]
    Yep, with sessions.

    --
    Sharif Tanvir Karim



    Comment

    • Peter Taurins

      #3
      Re: getting variables from one page to the other

      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" <sharif@nyc.rr. com> wrote in message
      news:bDtAb.3527 89$pT1.23225@tw ister.nyc.rr.co m...[color=blue]
      > "edward hage" <edha@xs4all.nl > wrote in message
      > news:3fd2658a$0 $211$e4fe514c@n ews.xs4all.nl.. .[color=green]
      > > 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="resulta at.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_global s 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_global s on?
      > >
      > > I tried (being a newby) $_GET["teller'] but that did not work.
      > >
      > > Thanks in advance, Edward
      > >[/color]
      > Yep, with sessions.
      >
      > --
      > Sharif Tanvir Karim
      > http://www.onlyonxbox.net
      >
      >[/color]


      Comment

      Working...