...

request not inialized error is occured can any body help me please

musk
07-01-2007, 01:43 PM
THIS IS MY HTML FILE
can some one help me please
<?PHP
extract( $_POST );
?>
<!------------------------------------------------------------------------------------------*
THE WELCOME PAGE
*------------------------------------------------------------------------------------------->
<html>
<head>
<title> CLC-City of London College </title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript">
/*===========================CHANGE THE COLOR OF TEXT ON MOUSE OVER========================*/

function changefontcolor(ref, fontcolor){
ref.style.color=fontcolor;
}
/*==========================CHANGE THE COLOR OF TEXT ON MOUSE CLICK========================*/
function changecoloronclick(fontcolor){
document.fgColor = fontcolor;
}
/*=========================================================================================*/
/////////////////////////////////////////////////////////////////////
function showStudent()
{
xmlHttp=GetXmlHttpObject()
alert("you are in the show student function")
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var a = "122013";
var url="myprofile.php"
url=url+"?q="+a
url=url+"&sid="
alert("you are near to exit")
xmlHttp.onreadystatechange=stateChanged()
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
/////////////////////////////////////////////////////////////////////
function stateChanged()
{
alert("you are in the state change function")
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
{
alert("you are in if condition")
document.getElementById("txtHint").innerHTML=xmlHttp.responseText

}
else if (xmlHttp.readyState == 1 )
{
alert("your request has been setup");
}
else if (xmlHttp.readyState == 2 )
{
alert("your request has been send");
}
else if (xmlHttp.readyState == 3 )
{
alert("your request is in progress ");
}
else if (xmlHttp.readyState == 0 )
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText

alert("your request has not been initialized");
}
}
/////////////////////////////////////////////////////////////////////
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch(e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
/////////////////////////////////////////////////////////////////////
</script>
</head>
<body>
<div id="page">
<div id = "head">
<table class = table1>
<tr>
<td align = "center">
<img src="Image/logo.gif" alt="logo"></img>
</td>
</tr>
</table>
</div>
<div id = "left">
<b>
</br>
<a onmouseover= "changefontcolor(this, 'blue')" onmouseout="this.style.color='black'" href="javascript:void(0)" onclick="showStudent()" id = dec>
&nbsp ¬ My Profile</a>
<hr color= #FFFFFF size = 10 width =100% >
<a onmouseover= "changefontcolor(this, 'blue')" onmouseout="this.style.color='black'" href="javascript:void(0)" id = dec>
&nbsp ¬ Download Past Papers</a>
<hr color= #FFFFFF size = 10 width = 100% >
<a onmouseover= "changefontcolor(this, 'blue')" onmouseout="this.style.color='black'" href="javascript:void(0)" id = dec>
&nbsp ¬ Lecture Material</a>
<hr color= #FFFFFF size = 10 width = 100% >
</b>
</div>
<div id = "middle">
<p><div id="txtHint"><b>User info will be listed here.</b></div></p>
</div>
</div>
</body>
</html>

This is my PHP File

<?PHP
echo "You are here";
$q =$_GET["q"];
$username="";
$password="";
$database="college";
$con = mysql_connect(localhost,$username,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
@mysql_select_db($database, $con);
$query = "Select * from students";
$result = mysql_query($query);
$num = mysql_numrows($result);
$fname = mysql_result($result,0,"STUDENT_FIRST_NAME");
echo "$fname";
mysql_close($con);
?>

A1ien51
07-10-2007, 01:22 AM
It would help if you actually used colors that people could read. light orange on white is bad. LIme on white is bad. Stick with classic black on white.

Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum