How to use $_Get to store its values in a database? - php

I want to display all users that a "super" user is responsible for. Then the "super" user can send a comment to any of the users by clicking on their user id.
The first part of showing all the users is working fine! My problem is in sending a comment by the super user. I want to store the user id (ie suid) in the database. So I think to use the $_Get function. But when I tried it, nothing stores in the database. I think I made a mistake in it. So can anyone help me on that?
This is the code that will show all users to the super user:
<?php
session_start();?>
<?php
require("noCache.php");
$uid=$_SESSION['uid'];
?>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Send a comment</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.4.2.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-replace.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_400.font.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_700.font.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_600.font.js"></script>
</head>
<body>
<div class="main">
<header>
<div class="wrapper">
<h1> Biz</h1>
</div>
<nav>
<ul id="menu">
<li class="alpha"><span><span>Home</span></span></li>
<li><span><span>About</span></span> </li>
<li><span><span>Projects</span></span></li>
<li><span><span>Contacts</span></span></li>
<li class="omega"><span><span>Services</span></span></li>
</ul>
</nav>
</br></br>
</header>
<head>
<!-- CSS Stylesheet -->
<style type="text/css">
html{
}
body{
text-align:center;
}
</style>
</head>
<?php
$dbh=mysql_connect("localhost", "root", "hahaha1") or die (mysql_error());
mysql_select_db ("senior");
$result = mysql_query("SELECT * FROM sensorusers where uid=$uid");
echo "<html><body>";
echo "<table cellspacing=10 cellpadding=5 ><tr> <th>ID</th><th>Name</th><th>Username</th><th>Password</th><th>Date of Registeration</th><th>Phone</th></tr>";
while ($row = mysql_fetch_array($result))
{ echo "<form method='post' action='sendcomment.php'>";
echo "<tr><td><input type='submit' name='suid' value='".$row['suid']."' /></td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['dusername'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['phone'] . "</td></tr></form>";
$_GET['suid'] = $row['suid'];
}
echo "</table></body></html>";
mysql_close($dbh);
?>
<html>
<body>
<!-- CSS Stylesheet -->
<style type="text/css">
body {
font-family:"Andalus"
font: 16px ;
color:black;
padding: 30px 5px;
text-align: center;
}
</style></body></html>
Here is the part that I want to ask about:
echo "<table cellspacing=10 cellpadding=5 ><tr> <th>ID</th><th>Name</th><th>Username</th><th>Password</th><th>Date of Registeration</th><th>Phone</th></tr>";
while ($row = mysql_fetch_array($result))
{ echo "<form method='post' action='sendcomment.php'>";
echo "<tr><td><input type='submit' name='suid' value='".$row['suid']."' /></td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['dusername'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['phone'] . "</td></tr></form>";
$_GET['suid'] = $row['suid'];
}
Solution:
Thank you all for helping. I fixed the code. I used method post to save the value of suid the first time. Then I print it as a hidden input. Finally I save the value of the hidden input in the sql and it works!

you have POST I DONT SEE GETin your code , and its depend on your html inputs (u didnt post them)if u make method GET or POST.
if your method is GET then you use GET
but try use this
if(isset($_POST['submit'])){
instead of
if($submit){
EDIT .
you are using method='post'
then you must use POST not GET
EDIT2:
you have an error in your sql , you used VALUE and it should be VALUES
instead of this
$place="INSERT INTO comments VALUE
replace it by
$place="INSERT INTO comments (columns here ,..., ,..) VALUES

How to use $_GET:
Put the data in the URL like so:
sendcomment.php?suid=blahblahblah
Then you can use $_GET, like so:
$suid = $_GET['suid']
Currently your code uses POST to send suid
Or change your form method.
echo "<form method='post' action='sendcomment.php?suid=".$row['suid']."'>";

There are multiple issues in your code. I will try to list the biggest ones, but may still miss some.
Code 1 -
Issue 1-
You have multiple <html></html>,<head></head>, and <body></body> blocks.
<html>
...
<head>
...
</head>
<body>
...
<head>
...
</head>
...
echo "<html><body>";
...
echo "...</body></html>";
...
<html>
<body>
...
</body>
</html>
Issue 2-
Your <form> is around a <td> block, which is invalid, so it will not POST properly. It either needs to be around the table <form><table></table></form>, or inside a cell <td><form></form></td>.
echo "<table cellspacing=10 cellpadding=5 ><tr> <th>ID</th><th>Name</th><th>Username</th><th>Password</th><th>Date of Registeration</th><th>Phone</th></tr>";
while ($row = mysql_fetch_array($result))
{ echo "<form method='post' action='sendcomment.php'>";
echo "<tr><td><input type='submit' name='suid' value='".$row['suid']."' /></td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['dusername'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['date'] . "</td>";
echo "<td>" . $row['phone'] . "</td></tr></form>";
$_GET['suid'] = $row['suid'];
}
echo "</table></body></html>";
Issue 3-
You are misusing $_GET and it is outside your <form></form> tags. $_GET is used to get value from the url.
$_GET['suid'] = $row['suid'];
Code 2-
Issue 1-
You are setting $id1=$_GET["suid"];, but in your form in Code #1, you are using method="post".
$id1=$_GET["suid"];
Issue 2-
When you are posting from Code #1 to Code #2 (<form><input type='submit' name='suid' value='".$row['suid']."' /></form>), you are only sending name='suid', so all your $_GET & $_POST vars will not be set to be used in the INSERT-
$id1=$_GET["suid"];
...
$name=$_POST['sent_by'];
$id=$_POST['hidden_id'];
$id2=$_POST['hidden_id2'];
$message=$_POST['message'];
$submit= $_POST['submit'];
...
Issue 3-
You have errors in you query. It should be VALUES, not VALUE, you should include the columns before `INSERT INTO comments (id,name,message,receiver,sender,date,time) VALUES ('','$name','$message','$id','$id1','$date','$time')
$place="INSERT INTO comments VALUE('','$name','$message','$id','$id1','$date','$time')";
$run = mysql_query("$place");
Issue 4-
All your value= in your form is missing the quotes '' around the values.
<form action="sendcomment.php" method="post">
<input type ='hidden' name='hidden_id' value = <?php print $uid; ?> >
<input type ='hidden' name='hidden_id2' value = <?php print $id1; ?> >
Name : <input type ='name' name='sent_by' value = <?php print $username; ?>></br>
Message: <textarea name='message'></textarea></br>
<input type='submit' value='submit' name="submit" /></br>
</form>
I know that you have accepted an answer, but you have a lot of code issues to still address. Each of these will cause you issues with your form and inserting into your database. Plus they will cause you more issues.

Just simply this
$id1=$_GET["suid"];
replace with
$id1=$_POST["suid"];
When using $_GET varible shuld be in the url.
When using $_POST variable isn't shown in url

Related

Add selected data from one table to another table using 'onclick button HTML

My project is about Allergies and I am trying to add the allergies given in one table "List of Allergies" to another table "MyAllergies" with an onclick button "add" for each allergies given. What I want is when the user clicks on add button for one allergy, that specific allergy should automatically be added to the "MyAllergy.php". Please help me. I have been trying for 2 days and I got no where. However, I tried the query and it was almost correct. I would be so grateful. Thank you. Let me know if you want me to attach the other code or any more questions. :)
AddAllergy.php
<?php
include('Session.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Allergen Details</title>
<div align="center">
<h1>Allergen Information</h1>
</div>
</head>
<body>
<?php
$allergysql = 'SELECT Allergy,Description,Symptoms FROM FoodAllergy';
$retrieve = mysqli_query($connection, $allergysql);
if(!$retrieve)
{
die("Could not get data!".mysqli_error($connection));
}
print "
<table border=\"5\" cellpadding=\"7\" style=\"border-collapse: collapse\" bordercolor=\"#85144b\" width=\"100%\" id=\"AutoNumber2\" bgcolor=\"#7FDBFF\"><tr>
<th width=100>Allergy:</th>
<th width=100>Description:</th>
<th width=100>Symptoms:</th>
<th width=100>Status:</th>
</tr>";
while($rowA = mysqli_fetch_assoc($retrieve))
{
print "<tr>";
print "<td>" . $rowA['Allergy'] . "</td>";
print "<td>" . $rowA['Description'] . "</td>";
print "<td>" . $rowA['Symptoms'] . "</td>"; ?>
<td> <div align ="center"> <button type ="button" onclick="addallergy()">Add</button></div></td>
<script>
function addallergy() {
// WHAT SHOULD I ADD HERE?? //
alert ('Added to your profile!');
}
</script>
<?php
print "</tr>";
}
print "</table>";
?>
</body>
</html>

Get values of a checked box list,one at a time with PHP

Good Day to you.This is what I have been trying to do.
I have a php page where I have drop down list with options as lecturers and students.
Once I select any option, details regarding lecturers or students will be displayed in a div using ajax.
Code is as follows.(This will be called in onchange event of the drop down list with a javascript.
<?php
session_start();
require "configuration.php";
$q = intval($_GET['q']);
if($q==1)
{
$sql="SELECT * FROM temp_instructor_log";
$result = mysqli_query($con,$sql);
echo "<table>
<tr>
<th></th>
<th><u><B>NIC</u></B></th>
<th><u><B>Name</u></B></th>
<th><u><B>Email</u></B></th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>"?>
<input type="checkbox" name="emplist[]" value="<?php echo $row['nic']?>">
<?php echo "</td>";
echo "<td>" . $row['nic'] . "</td>";
echo "<td>" . $row['firstName'] ." ".$row['lastName']. "</td>";
echo "<td>" . $row['email']."</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
}
?>
Its working and giving me the display with checkboxes at the very beginning.
<?php session_start();
require "configuration.php";
?>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Manage courses</title>
<script type="text/javascript">
</script>
</head>
<body>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
if (isset($_POST['btnAccept']))
{
$utype=$_POST['category'];
$arr = $_POST['emplist'];
foreach( $arr as $item)
{
echo $item . "</br>"; /* Will print 1,2 and 3 (mind newlines)*/
}
First I tried to echo the values after checking some of the checkboxes.But it didnt work out.Your kind consideration given on this is highly appreciated.
Thanks in advance.

Need help displaying images from mysql to webpage

I have stored images in phpmyadmin in a BLOB format. When I try to display them on my webpage, weird symbols and letters show up. The pictures are a mix of jog and png. Please help.
Here is the code that I currently have.
<?php
session_start();
include 'dbConn.php';
if (!isset($_SESSION['username'])){
header("Location: clientLogin.php");
}
$query = "SELECT * FROM ip_games ";
$stmt = $dbConn->query($query);
$result = $stmt->fetchAll();
?>
<style>
body {
background-color: grey;
}
table {
margin: 0 auto;
}
td {
padding-right: 30px;
}
</style>
<html>
<body>
<div>
<form action="welcome.php">
<input type="submit" value="Sign out" />
</form>
</div>
<h1>Happy Face Emoji Games</h1>
<form>
Name: <?php echo $_SESSION['name'] ?> <br />
</form>
<table>
<?
for ($i=0; $i<count($result); $i++)
{
echo "<tr>";
echo "<td>" . $result[$i]["picture"] . "<br />" . $result[$i]["name"]. " <br /> " .$result[$i]["console"] . " <br />" . "$" . $result[$i]["cost"] . "</td>";
//echo "<td>".$result[$i]["console"]."</td>";
//echo "<td>".$result[$i]["description"]."</td>";
//echo "<td>".$result[$i]["cost"]."</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
To directly use the binary data as a an image source, you can use the data URI scheme, for example:
$uri = 'data:image/png;base64,'.base64_encode($row['binary-data']);
This URI can then be used directly as the image’s source:
background-image: url(<?php echo $uri; ?>)
<img src="<?php echo $uri; ?>">
not good practice, older browser issues, load issues and catching issues. cheer
You need to wrap your image in an <img> tag.
<img src="<?php echo $result[$i]["picture"]; ?>" />
Give that a try and let me know :).
Edit: I wrote that as if it was in the page, for your question you probably want:
echo "<td><img src='" . $result[$i]["picture"] . "' />" . "<br />"... etc.

How to get text from hyperlink?

Hello i'm new in php so i want to know if there's a way to get the text from a hyperlink that has been created by a loop?
is there any solution? my problem is that i can't get the name from the hyperlink so that i will pass that name to other page .
// i have this code which doesn't work.
<head>
<script language="javascript" type="text/javascript">
function GetText()
{
var linktext=document.getElementById('testlink').innerHTML;
<?php $_SESSION['name'] = "<script>document.write(lintext)</script>"?>
}
</script>
<title>Search</title>
<link rel="stylesheet" type="text/css" href="admincss.css" />
</head>
if($pic != "")
{
$total=mysql_affected_rows();
for($ff1=0;$ff1<$total;$ff1++)
{
print "<table width='100%' align='center' border='5'>";
print "<td width='20%'><img src=\"$pic\" height='100px' width='100px'/> </td>";
print "<td align = 'center' width='20%'><a onclick='GetText()' ' href='search.report.php' id='testlink'>$name</a></td>"; //
print "<td align = 'center'width='20%'>$bday</td>";
print "<td align = 'center'width='20%'>$no</td>";
print "<td align = 'center'width='20%'>$eadd </td>";
print "</table>";
}
}
I hope you are talking about this line:
print "<td align = 'center' width='20%'><a ' href='search.report.php' id='testlink'>$name</a></td>"; //
You need to write this line as below:
print "<td align='center' width='20%'><a href='search.report.php?name=$name' id='testlink'>$name</a></td>"; //
And then you can get the name on search.report.php file by this code:
$_SESSION['name'] = $_REQUEST['name'];
echo $_REQUEST['name'];
You cann't execute the PHP code in the JS file. so you need to send it on server as PHP is server side language.

passing php variables between frames

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>&nbsp<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>&nbsp" . $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">&nbsp 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.

Categories