Php Ajax

This is a discussion on Php Ajax within the PHP General forums, part of the PHP Programming Forums category; Hello, I have the following 2 files that I'm trying to get working. I am coming back to this ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-12-2008
Mike
 
Posts: n/a
Default Php Ajax

Hello,
I have the following 2 files that I'm trying to get working.
I am coming back to this project after a while and cant seem to
figure
out why it isnt working anymore.
Alert("Y") runs but I get a "not implemented" Errror before
Alert("X")
will run.

Home.php:(Simple Enough)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="NCAA.css" rel="stylesheet" type="text/css" />
<script src="selectuser.js"></script>
</head>
<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="500" border="1" align="center" cellpadding="0"
cellspacing="0" id="mainOne">
<tr>
<td>
<form>
<span class="LoginFont">Username</span>
<label>
<input name="U" type="text" id="U" size="15" />
</label>
<span class="LoginFont">Password</span>
<label>
<input name="P" type="text" id="P" size="15" />
</label>
<label>
<input type="button" name="LoginButton" id="LoginButton"
value="Login" onclick="process(U.value,P.value)" />
</form>
<div id="txtHint"></div>
</td>
</tr>
</table>
</body>
</html>


selectuser.js:
var xmlHttp
function process(a,b)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="http://www.XXXXXXX.com/NCAA/morephp.php"
url=url+"?U="+a+"&P="+b
xmlHttp.onreadystatechange=stateChanged()
alert("X")
xmlHttp.open("GET",url,true)
xmlHttp.send(null)


}


function stateChanged()
{
alert("Y")
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
test ("ReadyState = 4" )

if (xmlHttp.responseText == "<p>Wrong Username or Password Dufus</
p>")
{

document.getElementById("txtHint").innerHTML=xmlHt tp.responseText
}
else window.location = "http://www.XXXXXXX.com/NCAA/Main_Mockup.php"
}


}


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;


}


I through alerts in ant it SEEMS like xmlHttp.open might be the
problem but I'm not sure
XXXXXXX is my domain.

Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0