V
vncntj
I'm getting blank values, when I try to pass the values back to the
index.php page. I have the function on the onload event on the body.
this is my content.js function
function showContext() {
var objID = "content"
var serverPage = "person.php";
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
my index.php
<script type="text/javascript" src="content.js"></script>
<body onload="showContext()">
<?php
echo "<a href=\"index.php?id=".$row['ApplicationId'] ."\">" .
$row['ApplicationId']. "</a><br>" ;
?>
<div id="content" style="width: 105px; text-align: left; position:
absolute; top: 10px; left: 250px;"></div>
</body>
and my person.php
<?php
require_once('cc_class.php');
if(isset($id))
{
$id = $_REQUEST['id'];
}
else
{
$id = "TWBOO2";
}
$db = new db_class;
if(!$db->connect($this->host,$this->user,$this->pw, $this->db,
true))
{
$db->print_last_error(false);
}
$r = $db->cc_sql("Select Distinct FirstName from history Where
ApplicationId='$id'");
while ($row=$db->get_row($r, 'MYSQL_ASSOC')) {
echo $row['FirstName'] ."<BR>";
}
?>
thanks
index.php page. I have the function on the onload event on the body.
this is my content.js function
function showContext() {
var objID = "content"
var serverPage = "person.php";
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
my index.php
<script type="text/javascript" src="content.js"></script>
<body onload="showContext()">
<?php
echo "<a href=\"index.php?id=".$row['ApplicationId'] ."\">" .
$row['ApplicationId']. "</a><br>" ;
?>
<div id="content" style="width: 105px; text-align: left; position:
absolute; top: 10px; left: 250px;"></div>
</body>
and my person.php
<?php
require_once('cc_class.php');
if(isset($id))
{
$id = $_REQUEST['id'];
}
else
{
$id = "TWBOO2";
}
$db = new db_class;
if(!$db->connect($this->host,$this->user,$this->pw, $this->db,
true))
{
$db->print_last_error(false);
}
$r = $db->cc_sql("Select Distinct FirstName from history Where
ApplicationId='$id'");
while ($row=$db->get_row($r, 'MYSQL_ASSOC')) {
echo $row['FirstName'] ."<BR>";
}
?>
thanks