Jump to content

Unknown runtime Error with AJAX and Forms in IE.


GB_001

Recommended Posts

Hello,

everytime I include a <form> tag in the file my AJAX script is calling I get an Unknown Runtime Error in IE.

 

AJAX:

<script type='text/javascript'>
function  Profile()
{
var ajaxRequest; 

try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try{
ajaxRequest = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e){
// Something went wrong
alert('Your browser broke!');
return false;
}
}
}

ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
testme="contender";
testForObject(testme);
if(yes==1)
{
ajaxDisplay=parent.document.getElementById('contender');
}
else{
ajaxDisplay=document.getElementById('garbage');
}
ajaxDisplay.innerHTML = ajaxRequest.responseText;

}

}
var url = 'profile.php';
ajaxRequest.open('GET', url, true);
ajaxRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
ajaxRequest.send(null);

}
</script>

 

 

php/html:

 

<?php
session_start();
include('Connect.php');

$user=$_SESSION['email'];
$result = mysql_query("SELECT * FROM Ysers WHERE email='$user'");

$row = mysql_fetch_array( $result );


$name=$row['Name'];
$Ame=$row['aboutme'];
$Irests=$row['interests'];
$IMG=$row['Picture'];
$PIC="Images/$IMG"; 
list($width, $height, $type, $atrib) = getimagesize($PIC);

if($width>=300&&$width<=600&&$height>=400&&$height<=800||$width>=300||$height>=400)
{
$p=0.5;
$NW=$width*$p;
$NH=$height*$p;
}



else if($width>=600&&$width<=1200&&$height>=800&&$height<=1600||$width>=600||$height>=800)
{

$p=0.25;
$NW=$width*$p;
$NH=$height*$p;
}


else if($width>=1200&&$width<=2400&&$height>=1600&&$height<=3200||$width>=1200||$height>=1600)
{

$p=0.125;
$NW=$width*$p;
$NH=$height*$p;
}

else if($width>=300&&$height>=400)
{
$p=1;
$NW=$width*$p;
$NH=$height*$p;

}

echo"
<table valign=top align=center width=767px style='color:white; font-weight: bold; position: relative; left: 100px;'><td COLSPAN='2' width=767px style='text-decoration: underline;'>Edit Profile</td>
<tr>
<td COLSPAN=2 <font color=white><b><img src=$PIC width=$NW height=$NH style='text-align: center;' /></br></td></tr>
<tr>
<td>
Change Picture:<br></td></tr><tr><td><FORM ENCTYPE='multipart/form-data' ACTION='Iupload.php' METHOD='POST'> File: <INPUT TYPE='file' NAME='userfile'> <INPUT TYPE='submit' VALUE='Upload'> </FORM></td></tr>"; 
echo "<tr><iframe width=150px height=36px name='up' ></iframe><br/><td>About:<br>
  <textarea cols='45' rows='5' id='ame' style='overflow: hidden;'>$Ame</textarea></td></tr>
<tr><td>Interests: <br /><textarea cols='45' rows='5'>$Irests</textarea></td></tr></table>";
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.