Alright, I am currently creating a page that allows for the user to see a basic directory of user phone numbers and gives of variables. The issue I am having is that I have a link so that if you want all the users information you can click on it and it will pop-up a window containing more contact information. I've tried cookies and I have tried session/get/post, etc, I just seem to be doing something wrong.
Any help would be appreciated.
while($a=mysql_fetch_array($result)){
$id = $a[id];
$query2 = "SELECT * FROM contacts WHERE id = '$id'";
$result2 = mysql_query($query2);
$b=mysql_fetch_array($result2);
echo "<tr>";
echo "<td align = \"center\">".$a['fname']." ".$a['lname']."</td>";
echo "<td align = \"center\">".$b['h_phone']."</td>";
echo "<td align = \"center\">".$b['c_phone']."</td>";
echo "<td align = \"center\">".$b['w_phone']."</td>";
echo "<td align = \"center\">".$b['f_phone']."</td>";
echo "<td align = \"center\">".$b['email_1']."</td>";
echo '<td align="center">';
echo '<input type="submit" id="mode" name="mode" value="Look-up" onclick ="popup();"><br>';
echo '</td>';
echo "</tr>";
}
database_disconnect($db);
echo '</table>';
}
?>
The function pop-up() is just:
<script type="text/javascript">
<!--
function popup(var id) {
window.open( "page.php?id="+$id, "myWindow",
"status = 1, height = 300, width = 650, resizable = 0" )
}
//-->
</script>
Then on the receiving page:
$id = $_GET['id'];
echo '<table width="100%" border="1">';
echo "<tr>";
echo $id;
echo "</tr>";
...
echo '</table>';
I know it is definitely incorrect but I am learning :X