trying to passing values....

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
 
G

GArlington

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

FF & Firebug and IE & IE Developer toolbar (& Fiddler2) will answer
all your questions for you...
 
V

vncntj

Thanks for the insight!

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

FF & Firebug and IE & IE Developer toolbar (& Fiddler2) will answer
all your questions for you...- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top