Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   access the variable from one file to third file (http://www.go4expert.com/forums/access-variable-file-file-t3903/)

deepakagrawal 17Apr2007 11:34

access the variable from one file to third file
 
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 .....

pradeep 18Apr2007 18:56

Re: access the variable from one file to third file
 
I see that $query1 is not defined in the first PHP file.


All times are GMT +5.5. The time now is 13:58.