Passing values from one php page to another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    Passing values from one php page to another

    I'm developing web application using php and my sql. And use Jpgraph for graph creation. Because of the probelm to edit jpgraph php file i want to pass values to it.

    Ex. main.php have
    [PHP]if(isset($_POST['Submit_DISPLAY '])){
    $last=$_POST['las'];
    $SID=$_POST['SID'];
    $Date=$_POST['Date'];

    $today = date("y-m-d H:i:s");
    ;
    $q = mysql_query("SE LECT * FROM db WHERE ' AND SID= '$SID'");
    while($row = mysql_fetch_arr ay($q)){
    foreach( $row AS $key => $val ){
    $$key = stripslashes( $val );
    }

    }
    }

    [/PHP]
    i want to pass this values to jpgraph.php. How can i do that?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by ghjk
    I'm developing web application using php and my sql. And use Jpgraph for graph creation. Because of the probelm to edit jpgraph php file i want to pass values to it.

    Ex. main.php have
    [PHP]if(isset($_POST['Submit_DISPLAY '])){
    $last=$_POST['las'];
    $SID=$_POST['SID'];
    $Date=$_POST['Date'];

    $today = date("y-m-d H:i:s");
    ;
    $q = mysql_query("SE LECT * FROM db WHERE ' AND SID= '$SID'");
    while($row = mysql_fetch_arr ay($q)){
    foreach( $row AS $key => $val ){
    $$key = stripslashes( $val );
    }

    }
    }

    [/PHP]
    i want to pass this values to jpgraph.php. How can i do that?
    to pass values between pages you can use: POST, GET, SESSION and COOKIE.

    Have a read about them - SESSION or GET may be more suited.

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      ghjk: You asked the same question (more or less) in another thread by you Using sessions in PHP

      Why are you asking it again here?

      Ronald

      Comment

      • ghjk
        Contributor
        • Jan 2008
        • 250

        #4
        Originally posted by ronverdonk
        ghjk: You asked the same question (more or less) in another thread by you Using sessions in PHP

        Why are you asking it again here?

        Ronald

        Im new to php and i don't know session can use to above problem also.

        Comment

        • TheServant
          Recognized Expert Top Contributor
          • Feb 2008
          • 1168

          #5
          Originally posted by ghjk
          Im new to php and i don't know session can use to above problem also.
          Did you do the tutorial on Sessions markus gave you? If so, do you not understand something? WHy ahve you not tried to use sessions in you code?

          Comment

          Working...