Hello to everyone I'm new to this and I'm trying to make a simple dynamic HTML. I have written the following code but it seems dose not work. Can someone help me. Because All I get is the following line
$row[name]"); echo (""); echo (""); echo (""); echo (""); } ?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table>
<tr>
<td align="center">EDIT DATA</td>
</tr>
<tr>
<td>
<table border="1">
<?
mysql_connect("localhost","user","pass");
mysql_select_db("Computers");
$order = "SELECT * FROM vnc";
$result = mysql_query($order);
while ($row=mysql_fetch_array($result)){
echo ("<td>$row[name]</td>");
echo ("<td>$row[department]</td>");
echo ("<td>$row[phone]</td>");
echo ("<td>$row[ip]</td>");
echo ("<td>Edit</td></tr>");
}
?>
</table>
</td>
</tr>
</table>
</body>
</html>
Thank you in advance
This should work for you
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table>
<tr>
<td align="center">EDIT DATA</td>
</tr>
<tr>
<td>
<table border="1">
<?php
mysql_connect("localhost","user","pass");
mysql_select_db("Computers");
$order = "SELECT * FROM vnc";
$result = mysql_query($order);
while ($row=mysql_fetch_array($result)){
echo "<td>" . $row[name] . "</td>
<td>" . $row[department] . "</td>
<td>" . $row[phone] . "</td>
<td>" . $row[ip] . "</td>
<td>Edit</td></tr>";
}
?>
</table>
</td>
</tr>
</table>
</body>
</html>
I'm not sure why you used the parenthesis, but what you're looking for is something similar to this:
echo "<td>" . $row[name] . "</td>";
Anything written inside the quotations will be displayed explicitly, which is why you have to end the quotes, add a period, then give the array, followed by another period and opening quotes.
The
<? should be <?php .... It apprears that short tags is turned off on your webserver. also echo does not need parentheses
The correct syntax is this:
echo "<td>".$row['name']."</td>";
If your queries are working well, it should print something.
echo ("<td>Edit</td></tr>");
This line is problematic. You're trying to print double quotes in a double-quoted string. Try using single quotes instead.
There are some sintax error in your code you don't need to use parethesis
echo "<td>$row[name]</td>";
echo "<td>$row[department]</td>";
echo "<td>$row[phone]</td>";
echo "<td>$row[ip]</td>";
Also this line needs to be fixed because of double quotes used in anchor, you can either change to single quote or escape it with a backslash
echo '<td>Edit</td>';
Or
echo "<td>Edit</td>";
I would finally advise you to switch to long tags <?php
Related
I am getting the following validation error, it claims I have "misplaced non-space characters inside the table" I have tried everything and for the life of me cannot fix this error. The error is the following
Here is the PHP/HTML being used for
<?php
$title = "Alter Records";
include('includes/head.php');
include('includes/nav.php');
ini_set('display_errors', 0);
require_once('config.php');
require_once('db_class.php');
$connection = new dbController(HOST,USER,PASS,DB);
$sql = "select id,name, image,location from location";
$results = $connection->getAllRecords($sql);
//var_dump($results);
?>
<table>
<tr>
<th>Id</th>
<th>Name</th>
<th>Location</th>
<th>Image</th>
<th colspan="2">Make Changes</th>
</tr>;
<?php
foreach ($results as $row){
echo "<tr>";
echo "<td>{$row['id']}</td>";
echo "<td>{$row['name']}</td>";
echo "<td>{$row['location']}</td>";
echo "<td><img class='thumb' src='{$row['image']}' alt='{$row['name']}'> </td>";
echo "<td><a href=''>Update</a></td>";
echo "<td><a href='delete_record.php?id={$row['id']}'>Delete</a></td>";
echo "</tr>";
}
echo "</table>";
include('includes/footer.php')
?>
Here is the code inside validator.w3.org
↩
<!DOCTYPE html>↩
<html lang="en">↩
<head>↩
<meta charset="utf-8">↩
<title>Alter Records</title>↩
<link href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap" rel="stylesheet">↩
<link href="https://fonts.googleapis.com/css2?family=Bellota+Text:ital,wght#1,300;1,400&display=swap" rel="stylesheet">↩
<link rel="stylesheet" href="css/style.css">↩
</head>↩
<body>↩
<header><h1> TOURISM VICTORIA</h1></header>↩
<nav>↩
<ul class="flex-nav">↩
<li>Home</li>↩
<li>Add</li>↩
<li>Alter</li>↩
<li>↩
<form class="search-form" action="search.php" method="get">↩
<input type="text" name="search">↩
<button type="submit">Search</button>↩
</form>↩
</li>↩
</ul>↩
</nav>↩
<table>↩
<tr>↩
<th>Id</th>↩
<th>Name</th>↩
<th>Location</th>↩
<th>Image</th>↩
<th colspan="2">Make Changes</th>↩
</tr>;↩
<tr><td>1</td><td>Melbourne ShowGrounds</td><td>Royal Melbourne Showgrounds. Ascot Vale, Victoria, Austra
Any assistance with this would be greatly appreciated. If I am still unclear, please ask for further clarification.
just seeing your last include will also result in an error, you will need to end with ;
I am populating an HTML table with information from a database and want to trigger it with a button.
Can someone help me with this, and perhaps add some links to relevant website with examples?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div method="GET">
<table>
<thead>
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Usuario</th>
</tr>
<?php
include "php/populate.php";
?>
</thead>
</table>
<input type="button" value="button" id="button">
</div>
</body>
</html>
<?php
$result = mysqli_query($enlace,"SELECT * FROM tb_personas");
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['ID'] . "</td>";
echo "<td>" . $row['txt_nombre'] . "</td>";
echo "<td>" . $row['txt_usuario'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($enlace);
?>
You need to use jQuery (the easiest way to use ajax)
take a look at this question on stackoverflow how to call a php script on a html button click
additionally you are including your data at table's header, instead they should be included in table's body.
<table>
<thead>
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Usuario</th>
</tr>
</thead>
<tbody>
<?php include "php/populate.php"; ?>
</tbody>
</table>
I want to retrieve data from MySql table. I am using Xampp, phpMyAdmin etc... I followed this tutorial step by step: https://www.youtube.com/watch?v=IHdd02IK2Jg
But I get this error:
Notice: Undefined variable: records in C:\XAMPP\htdocs\display_prsc.php on line 29
And a warning:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in C:\XAMPP\htdocs\display_prsc.php on line 29
It just displays the column names when i run it.
<? php
//make connection
mysql_connect('localhost','root','');
//select_db
mysql_select_db('mynewdb');
$sql="SELECT * FROM new";
$records=mysql_query($sql);
?>
<html>
<head>
<title>Program Scores Table</title>
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>Year</th>
<th>Criteria</th>
<th>Score</th>
<tr>
<?php
while ($new=mysql_fetch_assoc($records)){
echo"<tr>";
echo"<td>".$new['py']."</td>";
echo"<td>".$new['pcrit']."</td>";
echo"<td>".$new['psco']."</td>";
echo"</tr>";
}
?>
</table>
</body>
</head>
</html>
You have a few errors in your code:
1. Wrong php opening tag
You have to remove the space in your php opening tag, e.g.
<?php
2. Weird html
Almost your entire html is wrong! I would recommend you to read a book or watch a basic html tutorial
So your entire code should look something like this:
<?php
//make connection
mysql_connect('localhost', 'root', '');
//select_db
mysql_select_db('mynewdb');
$sql = "SELECT * FROM new";
$records = mysql_query($sql);
?>
<html>
<head>
<title>Program Scores Table</title>
</head> <!-- head tag closed here -->
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>Year</th>
<th>Criteria</th>
<th>Score</th>
</tr> <!-- forgot / to close the tag -->
<?php
while ($new = mysql_fetch_assoc($records)){
echo "<tr>";
echo "<td>" . $new['py'] . "</td>";
echo "<td>" . $new['pcrit'] . "</td>";
echo "<td>" . $new['psco'] . "</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
Side Notes:
1. What can be improved?
I would do some basic error checking e.g. if the connection failed and so on
Use mysqli_* with prepared statements, or PDO with prepared statements, they are much safer! (We live in 2015)
(Also if the guy in your tutorial uses mysql_*, change the tutorial!)
So that you don't only have your old code working, here your improved code:
<?php
//Database stuff
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "mynewdb";
try {
$dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare("SELECT * FROM new");
$stmt->execute();
//Close Connection
$dbh = null;
} catch(PDOException $e) {
echo $e->getMessage();
}
?>
<html>
<head>
<title>Program Scores Table</title>
</head>
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>Year</th>
<th>Criteria</th>
<th>Score</th>
</tr>
<?php
while ($new = $stmt->fetch(PDO::FETCH_ASSOC)){
echo "<tr>";
echo "<td>" . $new['py'] . "</td>";
echo "<td>" . $new['pcrit'] . "</td>";
echo "<td>" . $new['psco'] . "</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
2. Coding side notes
Add error reporting to the top of your file(s) which will help find errors.
<?php
ini_set("display_errors", 1);
error_reporting(E_ALL);
?>
Error reporting should only be done in staging, and never production.
Note the space in your first php tag.
You have <? php , it should be <?php
And since it seems you are starting to learn, avoid learning things deprecated. Don't use MySQL, use PDO or Mysqli.
try
<?php
//make connection
$con= mysql_connect('localhost','root','');
//select_db
$select= mysql_select_db('mynewdb',$con);
$sql="SELECT * FROM new";
$records=mysql_query($sql);
?>
<html>
<head>
<title>Program Scores Table</title>
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>Year</th>
<th>Criteria</th>
<th>Score</th>
<tr>
<?php
while ($new=mysql_fetch_array($records)){
echo"<tr>";
echo"<td>".$new['py']."</td>";
echo"<td>".$new['pcrit']."</td>";
echo"<td>".$new['psco']."</td>";
echo"</tr>";
}
?>
</table>
</body>
</head>
</html>
I recommend you using Prepared statements for MySQL instead of clean MySQL, it's not secure at all, and will give you problems later on.
A lille guide here.
http://www.w3schools.com/pHp/php_mysql_prepared_statements.asp
There are multiple errors in your code. But for the error, it is due to mysql_query() returns FALSE at line:
$records=mysql_query($sql);
Then, the line while ($new=mysql_fetch_assoc($records)){ cannot get the value of $records, thus produce the errors.
Other errors are:
HTML
missing DOCTYPE
missing meta charset
a missing </tr>
a misplaced </head>
be modern, use CSS to style your HTML instead of using HTML tag attributes
PHP
didn't check the return value of functions before using them
use of deprecated mysql_* functions; use PDO / MySQLi instead
extra space at <? php
I"m having trouble with my code hopefully someone can help.
I'm trying to call information using "php echo" to display information in table form and it works except for the links which doesn't recognize the $id. If I don't put it in the table form it works fine but it is not aesthetically appealing.
Any suggestions would be greatly appreciated!
<?php
session_start();
if(!isset($_SESSION['name'])){
header("location: ../index.php");
exit();
}
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
include_once("../scripts/connect.php");
// Delete Item Question to Admin, and Delete Product if they choose
if (isset($_GET['deleteid'])) {
echo 'Do you really want to delete messages with ID of ' . $_GET['deleteid'] .'? Yes | No';
exit();
}
if (isset($_GET['yesdelete'])) {
// delete from database
$id_to_delete = $_GET['yesdelete'];
$sql = mysql_query("DELETE FROM `mystore`.`messages` WHERE `messages`.`id` = '$id_to_delete' LIMIT 1") or die (mysql_error());
}
$messages = "";
$sql = mysql_query("SELECT * FROM messages ORDER BY msg_date DESC LIMIT 20");
$count = mysql_num_rows($sql);
if($count > 0){
while($row = mysql_fetch_array($sql)){
echo '<tr>';
echo '<td>'.$row['msg_name'].'</td>';
echo '<td>'.$row['msg_email'].'</td>';
echo '<td>'.$row['msg_subject'].'</td>';
echo '<td>'.$row['msg_date'].'</td>';
echo '<td>Reply</td>';
echo '<td>Delete</td>';
echo '</tr>';
}
}else{
$messages = "<b>There are no messages in the database at this moment</b>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Messages</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style/forms.css" media="screen">
<link rel="stylesheet" href="style/main.css" media="screen">
</head>
<body>
<div id="main_wrapper">
<?php include_once("templates/tmp_header.php"); ?>
<?php include_once("templates/tmp_nav.php"); ?>
<section id="main_content">
<h2 class="page_title">Messages</h2>
<br/>
<table width="730" cellspacing="0" cellpadding="3" border="1">
<tr>
<td align="center" width="100">From</td>
<td align="center" width="300">Email</td>
<td align="center" width="300">Subject</td>
<td align="center" width="100">Date</td>
<td align="center" width="100">Actions</td
></tr>
<?php echo $messages; ?>
</table>
</section>
<?php include_once("templates/tmp_aside.php"); ?>
<?php include_once("templates/tmp_footer.php"); ?>
</div>
Please change
echo '<td>Delete</td>';
to
echo "<td><a href='admin_messages.php?deleteid=$id'>Delete</a></td>";
when trying to print out a variable the main string has to be wrapped in double quotes.
If you want to interpolate variables in PHP, you need to use double quotes. echo '$id' will literally print $id, whereas echo "$id" will print the value of the variable. However, I would recommend an alternative approach. Don't use PHP where it isn't needed. There's no need to use echo so much.
I would change the contents of your loop to this:
?>
<tr>
<td><?=$row['msg_name']?></td>
<td><?=$row['msg_email']?></td>
<td><?=$row['msg_subject']?></td>
<td><?=$row['msg_date']?></td>
<td>Reply</td>
<td>Delete</td>
</tr>
<?php
The <?=$id?> is shorthand for <?php echo $id?> and is supported by default in PHP versions >=5.4.0. You can also use it in previous versions if you enable short_open_tags.
As stated in the comments, you should really be using mysqli functions, as mysql functions are deprecated.
I have a PHP variable inside a frame from a frameset that needs to be passed to two other frames simultaneously. One of those frames refreshes every 5 seconds and will easily grab the variable from the URL. The other frame does not refresh as it is a form. That frame/form needs to populate a disabled field before information is sent (perhaps doable in AJAX, I don't know).
I am not versed in anything other than HTML, CSS and basic PHP, so I have become hung up this problem.
Please refer to the code and for more explanation - Thanks!!
Well, I have a picture, but due to my reputation being too low, I cannot show you... figures.
Anyways, here's the code:
main frame page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Incident Entry</title>
</head>
<frameset border="0" frameborder="0" rows="50%,50%">
<frameset border="0" frameborder="0" cols="40%,60%">
<frame src="incidententry.php" name="topleft">
<frameset border="0" frameborder="0" rows="56%,44%">
<frame src="detailentry.php" name="toprighttop">
<frame src="details.php" name="toprightbottom">
</frameset>
</frameset>
<frame src="incidents.php" name="bottom">
</frameset>
</html>
incidents.php:
<?php header ('Refresh: 5');
session_start();
if($username);
?>
<!DOCTYPE html>
<html lang="en">
<title>Incidents</title>
<?php mysql_connect("-----", "-----", "------");
#mysql_select_db(-----_incidents);
$sql2="SELECT * FROM incidents ORDER BY id DESC LIMIT 10";
$result2=mysql_query($sql2);
$num=mysql_numrows($result2);
?>
<head>
<link rel="stylesheet" type="text/css" href="output1.css">
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0)">
<meta http-equiv="Page-Enter" content="revealtrans(duration=0.0">
<style type="text/css">
body{background-color:black}
body{font-family:'trebuchet ms' }
</style>
</head>
<body>
<font color="white">
<div class="CSSTableGenerator">
<table border='0' rules='all' width='75%'>
<tr class="hideextra">
<td>Inc #</td>
<td>Date</td>
<td>Time</td>
<td>City</td>
<td>Dept</td>
<td>Alarm Level</td>
<td>Incident Type</td>
<td>Address</td>
<td width="53px">User</td>
<td>Upgr</td>
</tr>
<?php
$_GET['id'];
while($row=mysql_fetch_array($result2)){
$id2 = $row['id'];
$id = str_pad($id2,9, "2013-0000", STR_PAD_LEFT);
$date=rtrim(ltrim($row['date'], "2013-"), "0..9,:");
$time=$row['time'];
$city=$row['city'];
$fire=$row['fire'];
$addy=$row['addy'];
$level=$row['level'];
$desc=$row['desc'];
$units=$row['units'];
$who=$row['who'];
echo "<tr>";
echo "<td style='white-space:nowrap;'><center> <a href='http://www.------.com/pages/CAD/details.php?inci_num=$id' target='toprightbottom'>" . str_pad($row['id'],9,"2013-00000",STR_PAD_LEFT) . "</a></center></td>";
echo "<td style='white-space:nowrap;'><center>" . str_pad($date,6,'0',STR_PAD_LEFT) . "</center></td>";
echo "<td>" . $row['time'] . "</td>";
echo "<td>" . $row['city'] . "</td>";
echo "<td>" . $row['fire'] . "</td>";
echo "<td>" . $row['level'] . "</td>";
echo "<td>" . $row['desc'] . "</td>";
echo "<td>" . $row['addy'] . "</td>";
echo "<td>" . strtoupper($row['who']) . "</td>";
echo "<td><center><a href='http://www.------.com/pages/CAD/upgrade.php?id=$id2' target='_self'><img src='http://www.------.com/images/arrow_red_up.gif' height='16'></a></center></td>";
echo "</tr>";
echo "</div>";
}
?>
</table>
</html>
details.php:
<?php header ('Refresh: 5'); ?>
<!DOCTYPE html>
<html lang="en">
<title>Incident Details</title>
<?php
mysql_connect("-------", "-------", "------");
#mysql_select_db(------);
$inci_num2=$_GET['inci_num'];
$sql3="SELECT * FROM notes2 WHERE inci_num='$inci_num2' ORDER BY id DESC";
$result4=mysql_query($sql3);
?>
<head>
<link rel="stylesheet" type="text/css" href="output1.css">
<style type="css/text">
body{background-color:black}
body{font-family:'trebuchet ms' }
</style>
</head>
<body bgcolor="black">
<font color="white">
<div class="CSSTableGenerator">
<table rules="all">
<tr class="hideextra">
<td>#</td>
<td width="46px">Time</td>
<td>Incident Notes</td>
<td width="53px">User</td>
</tr>
<?php
$_POST['inci_num'];
while($row=mysql_fetch_array($result4)){
$id=$row['id'];
$ipaddress=$row['ipaddress'];
$inci_num=$row['inci_num'];
$notes=$row['notes'];
$Time1=$row['Time1'];
$user=$row['who'];
echo "<tr>";
echo "<td> " . $row['inci_num'] . "</td>";
echo "<td>" . $row['Time1'] . "</td>";
echo "<td>" . $row['notes'] . "</td>";
echo "<td>" . $row['who'] . "</td>";
echo "</tr>";
echo "</div>";
}
?>
</table>
</body>
and finally, detailentry.php:
<?php
session_start();
if($username)
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
$id2=$_GET['inci_num2'];
if(isset($_POST['submit'])){
$db=mysql_connect("------", "-----", "------") or die ("Cant connect");
$mydb=mysql_select_db("----_incidents") or die ("Cant find db");
$notes = mysql_real_escape_string($_POST['notes']);
$who = strtoupper($_COOKIE['username']);
$ipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
$inci_num1 = $_POST['inci_num'];
$inci_num = str_pad($inci_num1,9, "2013-0000", STR_PAD_LEFT);
if(!isset($_POST["auto"])){
$sql = "INSERT INTO `notes2` (`id` , `inci_num` , `notes` , `who` , `ipaddress` , `Date` , `Time1`) VALUES (NULL, '".$inci_num."' , '".$notes."' , '".$who."' , '".$ipaddress."' , NOW(), DATE_ADD(NOW(),INTERVAL 120 MINUTE))";
}else{
$sql = "INSERT INTO `notes2` (`id` , `inci_num` , `notes` , `who` , `ipaddress` , `Date` , `Time1`) VALUES (NULL, '".$inci_num."' , '".$notes."' , '".$who."' , '".$ipaddress."' , NOW(), DATE_ADD(NOW(),INTERVAL 120 MINUTE))";
}
$result = mysql_query($sql) or die ("Cant insert ".mysql_error());
if($result)
{
}
else
{
}}
?>
<title>Detail Entry</title
<head>
<style type="css/text">
body{overflow-y:hidden;
white-space-collapse:collapse;}
body{background-color:black}
body{font-family:'trebuchet ms' }
.body{font-family:'trebuchet ms' }
.hide{visibility:collapse; }
#hide{visibility:collapse; }
.nopad{padding-bottom:0px; margin-bottom:0px; }
.borders{ }
</style>
</head>
<body bgcolor="black" class="body" style="font-family:'trebuchet ms';">
<form action="detailentry.php" method="POST" style="white-space-collapse:collapse;">
<font color="white">
<table border="0" class="borders">
<tr>
<td><font color="white" size="3">Inc #:</font></td>
<td><font color="white"><input type="text" maxlength="11" value="<?php echo $id2;?>" required name="inci_num">  RM911 ID:</font></td>
<td><center><font color="white"><? echo strtoupper($_COOKIE['username']);?></font></center></td>
</tr>
<tr>
<td><font color="white">Notes:</td>
<td colspan="2"><textarea placeholder="Enter Incident Notes here" required rows="4" cols="36" name="notes"></textarea></td>
</tr><input id="hide" style="visibility:collapse;" class="hide" hidden type="checkbox" name="auto" value="auto" checked>
<tr class="nopad">
<td class="nopad" colspan="3" align="center"><input class="nopad" type="submit" name="submit" value="Submit"><input class="nopad" type="reset"></td>
</tr>
</table>
</form>
</body>
</html>
**Note: I know I should be using the new syntax, one thing at a time please. Also, I realize that the code be made nicer and easier to read. Again, that's secondary to fixing this problem.
This is what I am trying to accomplish:
I need to take the $id2 variable from the incidents.php page and simultaneously transfer it to both details.php and detailentry.php when the user clicks on the incident number on incidents.php. On detailentry.php, $id2 needs to be in the Inc #: text input box.
Thank you for your help in advance!!!
hmm. An 8 year old question nobody answered. and 2 "answers" that were just dismissive comments.
Here's a real answer: You can pass the data between frames by making a session variable. Session variables are accessible between frames. https://www.php.net/manual/en/reserved.variables.session.php has full info.
I see you have session_start() in two of your 3 php files. Add it to the top of the third one. Then assign a session variable with whatever value you want to pass to another frame:
$_SESSION['vartopass']=$varyouwanttopass;
now $_SESSION['vartopass'] is available in your other frames that start with session_start().
$variwantedinthisframe=$_SESSION['vartopass'];
So, yeah, 8 years late. You probably figured this out by now, but someone else hasn't, and I hate dismissive statements that don't help anyone.