'No element found' error

C

C.Joseph Drayton

Hi All,

I am not sure if this is a JavaScript or PHP error. Basically what
is happening, is that I have an HTML page with the following
JavaScript. As you can see makeRequest() calls a PHP script which is
included below.

When the code is executed, I get the following error in FireFox's
JavaScript console;
Error: no element found
Source File:
http://127.0.0.1:8000/pscripts/scr0...hello&hsnm=Tommy&hrnm=Tammy&cty=tacoma&stt=47
Line: 1, Column: 1
Source Code:
^<script language="javascript" type="text/javascript">
var result ;
var http_request = false ;
var ng= -1 ;
var reqFlag="available" ;

function makeRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('GET', url + parameters, false);
http_request.send(null);
}

function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
result = http_request.responseText;
RtVal = result;
} else {
alert('There was a problem with the request.');
}
}
}

function wrtmmbr()
{
if (vrfd=="submitted") {
alert ("Membership has been approved for "+vunm) ; return; }
if (vrfd=="yes") {
vunm = document.crnew.unm.value;
vpsswrd = document.crnew.psswrd.value;
veml = document.crnew.eml.value;
vhsnm = document.crnew.hsfname.value;
vhrnm = document.crnew.hrfname.value;
vcty = document.crnew.cty.value;
vstt = document.crnew.stt.value;

prm="?unm="+vunm+"&psswrd="+vpsswrd+"&eml="+veml+"&hsnm="+vhsnm+"&hrnm="+vhrnm+"&cty="+vcty+"&stt="+vstt;
reqFlag="wrtProfile" ; makeRequest('pscripts/scr0003.php',prm);
vrfd="submitted" ;
alert("Your Membership has been created, please log in.");
window.open("memberlogin.html","_self"); }
}


function ProcessData()
{
switch(reqFlag)
{
case 'chkUName' :
thrspns = result.indexOf("au~~th");
if (thrspns>ng) {
} else
{
alert(tmp2+" is not available. Please try again.");
document.crnew.cunm.focus(); return ;
}
break ;
case 'chkCity' :
thrspns = result.indexOf("fou~~und");
if (thrspns<0) {
alert("We can not find a City named "+tmp2) ;
document.crnew.stt.focus(); }
break ;
case 'wrtPassword' :
return;
break ;
case 'wrtProfile' :
return;
break ;
}
}
<?php

$host = "127.0.0.1";
$login = "root";
$pwd = "AntonMlaber";
$port = "3306";
$db = "mmbrdt";
$tblnm = "membership" ;
$lunm = $_REQUEST["unm"];
$lpsswrd = $_REQUEST["psswrd"];
$leml = $_REQUEST["eml"];
$lhsnm = $_REQUEST["hsnm"];
$lhrnm = $_REQUEST["hrnm"];
$lcty = $_REQUEST["cty"];
$lstt = $_REQUEST["stt"];
$tm = array() ;
$tm=localtime();
$tday = $tm[3];
$tmh = $tm[4] ;
$tmonth = $tmh+1 ;
$tyr = $tm[5] ;
$tyear = $tyr+1900;
$ll=$tyear."-".$tmonth."-".$tday;
$lsd=$tyear."-".$tmonth."-".$tday;
$host=$host.":".(integer)$port;
$conn=mysql_connect($host,$login,$pwd) or die();
$sql = "INSERT INTO $tblnm
(UserName,UserPassword,EmailAddress,HisFName,HerFName,City,State,RegDate,LastLogon,RenewalDate)
VALUES
('$lunm','$lpsswrd','$leml','$lhsnm','$lhrnm','$lcty','$lstt','$ll','$ll','$lsd')";
mysql_select_db($db,$conn) ;
mysql_query($sql);

$sql = "SELECT UserName FROM $tblnm WHERE UserName='$lunm'";
mysql_select_db($db,$conn) ;
$ProNum = mysql_query($sql);

$host = "127.0.0.1";
$login = "root";
$pwd = "AntonMlaber";
$port = "3306";
$db = "upw";
$tblnm = "pwds" ;
$sql = "INSERT INTO $tblnm (UserID,UserName,UserPwd,LastLogon)
VALUES ('$ProNum','$lunm','$lpsswrd','$ll')";
mysql_select_db($db,$conn) ;
mysql_query($sql);

?>
 
R

Randy Webb

C.Joseph Drayton said the following on 8/21/2006 4:45 PM:
Hi All,

I am not sure if this is a JavaScript or PHP error. Basically what
is happening, is that I have an HTML page with the following
JavaScript. As you can see makeRequest() calls a PHP script which is
included below.

When the code is executed, I get the following error in FireFox's
JavaScript console;

If the JS console is showing an error, then it is a JS error, but that
error may be caused by PHP generated code. Go figure.

Start adding alerts to your function to see when it errors out.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top