Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-01-2007, 01:43 PM   PM User | #1
musk
New to the CF scene

 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
musk is an unknown quantity at this point
request not inialized error is occured can any body help me please

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);
?>
musk is offline   Reply With Quote
Old 07-10-2007, 01:22 AM   PM User | #2
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
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
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:30 AM.


Advertisement
Log in to turn off these ads.