1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

access the variable from one file to third file

Discussion in 'Web Design, HTML And CSS Forums' started by deepakagrawal, Apr 17, 2007.

  1. deepakagrawal

    deepakagrawal New Member

    Joined:
    Apr 13, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hi,
    i have to access the variable from below file (var:- query1)
    **************************************************************
    Code:
    <?php
    session_start();
    ?>
    <form method=post action='frame0.php'>
    <b> Enter the Query:</b>
    <input type="text" name="query1" size=50 />
    <br>
    <input type=submit name=submit value="Sign!">
    <input type=reset name=reset value="Start Over">
    <?php
    $_SESSION["views"]="$query1";
    ?>
    </form>
    
    *****************************************************************
    To below file
    ********************************************************
    <html>
    <?php
    session_start();
    include 'config.php';
    $roll = 'CREATE DATABASE ids';
     mysql_select_db('ids')or die('Cannot select database');
    //$call = $_POST["query1"];
    $call = $_SESSION["views"];
    $result = mysql_query($call);
    while($row = mysql_fetch_array($result))
    {
    echo "<b>FirstName:</b>";
    echo $row["Name"];
    echo "<br>\n";
    echo "<b>Age:</b>";
    echo $row["Age"];
    echo "<br>\n";
    echo "<b>Location:</b>";
    echo $row["Location"];
    echo "<br>\n";
    };
    include 'closedb.php';
    ?>
    </html>
    *****************************************************************
    but i am trying to access that variable but it is not access.
    so ples tell me how can i access that variable .....
     
    Last edited by a moderator: Apr 17, 2007
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    I see that $query1 is not defined in the first PHP file.
     

Share This Page