"Operation Aborted" in IE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
beckwiga
Forum Newbie
Posts: 9
Joined: Wed Sep 21, 2005 7:45 pm

"Operation Aborted" in IE

Post by beckwiga »

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I am about to go jump off a bridge... I am hoping someone can talk me out of it.

http://beckwiga.homeip.net/maps/markers.php

My page is not displaying in IE.  It displays in FF, but my InfoWindows (googleMaps) are not functioning properly.  I have searched all over the web, including the googleMaps groups, and know that this has to do with the way my java script is being run.  I have been told that I need to move my JS to the <head> which I have tried, but my map page will not load.  I'm having trouble understanding where/why IE is struggling.  Anybody had to deal with this before?  Anyone offer any suggestions as to how I can rearrange my code to get around this?  Thanks in advance to anyone who has a look.

I have 2 relevant pages..

---------------
markers.php
---------------

Code: Select all

<?php

include ('process.php');
include('config.inc.php');
	$mWidth = 1200;
	$mHeight = 800;
	$mZoom = 5;
	

list($dbname, $dblink) = DB_CONN();

//error_reporting(E_ALL ^ E_NOTICE);

$markers_name = $_POST['markers_name'];
$markers_comment = $_POST['markers_comment'];
$markers_email = $_POST['markers_email'];
$markers_website = $_POST['markers_website'];
$x = $_GET['x'];
$y = $_GET['y'];

if(!empty($markers_name)) {
	$markers_ip = $_SERVER["REMOTE_ADDR"];
	$month = date(n);
	$day = date(j);
	$year = date(Y);
	$g = date(g)+1;
	$time = date($g.":".i." ".a);
	mysql_select_db($dbname, $dblink);
		$checklocationquery="SELECT markers_lat, markers_long
							  FROM markers;";
		$checklocationresult=mysql_query($checklocationquery);
		$markers_check = mysql_fetch_object($checklocationresult);
		
		if($markers_check->markers_long == $x && $markers_check->markers_lat == $y) {
			
		}
		else {
			$insertquery="INSERT INTO markers
					(markers_lat, markers_long, markers_name, markers_comment, markers_email, markers_website, markers_ip, markers_month, markers_day, markers_year, markers_time) 
					VALUES ('$x', '$y', '$markers_name', '$markers_comment', '$markers_email', '$markers_website', '$markers_ip', '$month', '$day', '$year', '$time');";
			$insertresult = mysql_query($insertquery);
			if(!$insertresult) {
				echo "Doh!  Error inserting your location into database."; exit;
			}
		}
		
}

mysql_select_db($dbname, $dblink);
	$query="SELECT * 
			FROM markers;";	
	$result = mysql_query($query);
	if(!$result) {
		echo "Doh!  Error getting markers from database."; exit;
	}

$a = 0;
while ($markers_row = mysql_fetch_object($result)) {
	/*$a = 0;
	$coord = array('name' => array($a => "$markers_row->markers_name"));
	$coord = array('long' => array($a => "$markers_row->markers_long"));
	$coord = array('lat' => array($a => "$markers_row->markers_lat"));
	$coord = array('comment' => array($a => "$markers_row->markers_comment"));*/
	$coord[$a]['long'] = $markers_row->markers_long;
	$coord[$a]['lat'] = $markers_row->markers_lat;
	$coord[$a]['name'] = $markers_row->markers_name;
	$coord[$a]['comment'] = $markers_row->markers_comment;
	//$a++;
	echo $coord[$a]['long'];
	echo $coord[$a]['lat'];
	echo $coord[$a]['name'];
	echo $coord[$a]['comment'];
	$a++;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-t-com:vml">
<head>
<style type="text/css">
	v\:* {
	  behavior:url(#default#VML);
	}
</style>
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAA3jEc3SJpbLm866CfKXKmRRRv2OgatP-igFqPyUJ3THPouBSGOhSjKdeZ5tRq9MyQ83A21kBZNuRI7g" type="text/javascript"></script>
<title>Map</title>
</head>

<body>

<div id="main">

		<div id="map" style="width: <?php echo"$mWidth"; ?>px; height: <?php echo"$mHeight"; ?>px; color: #000000;"></div>
		
<?php  // Create an instance of the mapping class

		$myMarkers = new googleMap;
		$myMarkers->showMap($coord, $mZoom);
		
?>

</body>
</html>

--------------
process.php
--------------

Code: Select all

<?php

class googleMap{
    function showMap($coord_array, $mapZoom){
      	//we have to have an address
		if (empty($coord_array)){
	  		echo "ERROR: You have not specified an address to map"; exit();
		}
        //Still needs an error check to make sure that addresses have been found.
        echo "
			<script type=\"text/javascript\">
			//<![CDATA[
			
			if (GBrowserIsCompatible()) {
				var icon = new GIcon();
					icon.image = \"http://labs.google.com/ridefinder/images/mm_20_red.png\"; //change this to be google default
					icon.shadow = \"http://labs.google.com/ridefinder/images/mm_20_shadow.png\";
					icon.iconSize = new GSize(12, 20);
					icon.shadowSize = new GSize(22, 20);
					icon.iconAnchor = new GPoint(6, 20);
					icon.infoWindowAnchor = new GPoint(5, 1);
					
				var icon1 = new GIcon();
					icon1.image = \"http://labs.google.com/ridefinder/images/mm_20_red.png\"; //change this to be google default
					icon1.shadow = \"http://labs.google.com/ridefinder/images/mm_20_shadow.png\";
					icon1.iconSize = new GSize(0, 0);
					icon1.shadowSize = new GSize(0, 0);
					icon1.iconAnchor = new GPoint(6, 20);
					icon1.infoWindowAnchor = new GPoint(5, 1);
			
				var map = new GMap(document.getElementById(\"map\"));
					map.addControl(new GSmallMapControl());
					map.addControl(new GMapTypeControl());
					map.centerAndZoom(new GPoint(-81.99079513549804, 26.544462124910293), ".$mapZoom."); //long,lat
				
				GEvent.addListener(map, 'click', function(overlay, pointa) {
					markera = new GMarker(pointa, icon1);
					map.addOverlay(markera);
					var y = pointa.y;
					var x = pointa.x;
					markera.openInfoWindowHtml(\"<form name='form1' method='post' action='markers.php?x=\"+x+\"&y=\"+y+\"'><table><tr><td align='right'>Name:&nbsp;</td><td><input name='markers_name' type='text' size='8'></td></tr><tr><td align='right'>Email:&nbsp;</td><td><input name='markers_email' type='text' size='8'></td></tr><tr><td align='right'>Website:&nbsp;</td><td><input name='markers_website' type='text' size='8'></td></tr><tr><td align='right'>Comment:&nbsp;</td><td><textarea name='markers_comment' cols='35' rows='6' wrap='VIRTUAL'></textarea></td></tr><tr><td></td><td><input name='submit' type='submit'value='Post Your Location'></td></tr></table></form>\");
				});
		";
				$numMarkers = sizeof($coord_array);
				for ($i=0; $i<$numMarkers; $i++){
				echo"
					var point".$i." = new GPoint(".$coord_array[$i]['lat'].", ".$coord_array[$i]['long'].");
					var marker".$i." = new GMarker(point".$i.", icon);
					map.addOverlay(marker".$i.");
					var html = \"Long/Lat: ".$coord_array[$i]['name'].", ".$coord_array[$i]['comment']."\"
					GEvent.addListener(marker".$i.", \"click\", function() 
					  {marker".$i.".openInfoWindowHtml(\"<b>Lat/Long:".$coord_array[$i]['lat'].",".$coord_array[$i]['long']."<\");
					});
					
					//
					
				";					
				}
echo"} 							
	//]]>
    </script>
";
	}
}

?>

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

HELP!!
Last edited by beckwiga on Sun Sep 25, 2005 7:46 pm, edited 1 time in total.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Okay, you have a bunch of things going wrong.

You have numerous undefined indexes, multiple javascript errors, html errors and more.

Its a mess.

Start by fixing the errors and warnings you can already see, and move forward from there. They might not be connected, involved, or even something you care about. However, they will help you move forward, so get them out of the way.

Once you fix the undefined indexes, we can dig in.
beckwiga
Forum Newbie
Posts: 9
Joined: Wed Sep 21, 2005 7:45 pm

Post by beckwiga »

Alright, I did a little cleanup maintenance. What other issues do you see?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Error: Error in parsing value for property 'z-index'. Declaration dropped.
Source File: http://beckwiga.homeip.net/maps/markers.php
Line: 0

Error: Expected ',' or '{' but found '*'. Ruleset ignored due to bad selector.
Source File: http://beckwiga.homeip.net/maps/markers.php
Line: 5

Use the javascript console in FF. It will help.
beckwiga
Forum Newbie
Posts: 9
Joined: Wed Sep 21, 2005 7:45 pm

Post by beckwiga »

I don't see those errors. Are you doing something specific to trigger those errors?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

beckwiga wrote:I don't see those errors. Are you doing something specific to trigger those errors?
I used the javascript console to monitor the javascript.

I posted that from a deerpark version, while now I am on 1.06, and don't see those warnings. Might be an issue with the js parser in the deerpark version, or a change you made, not sure.

The map looks good now with the exception of how it presents the data.

What specific problem are you looking to solve now?
beckwiga
Forum Newbie
Posts: 9
Joined: Wed Sep 21, 2005 7:45 pm

Post by beckwiga »

Do you use FireFox or IE or Both?

I use IE to open http://beckwiga.homeip.net/maps/markers.php using IE I get an Operation Aborted error. If I use FireFox, the page will load, however, I don't think its working properly (because my InfoWindow around the Lat/Long like a typical google map marker is not showing, not sure how familiar you are with google maps.) I have read several posts on google maps groups about how they say to fix this, but I have not had any luck rearranging my code. All suggestions indicate it has to do with how/where the JavaScript is placed within the code. Several people recommend putting the JS as a function within the <head> and calling it in the body. I have tried this without luck, however that is not how my current pages are coded. I have tried several other suggestions (searching on google maps group, "Operation Aborted"), changing from Strict to Transitional, some other stuff.

Here is one post specifically:

link

I am relatively new to php and JS (and web programming in general) so I am not that confident as to what goes where. Not sure how familar you are with google maps, but I am using php to generate the map marker coordinates on the server side. I don't think this should be that complex, I know my code is retrieving coordinates and everythign as it should from MySQL, and is plotting them how it should, its just something to do with the order of my JS within the html. I am not good with understanding when/where to use functions in the page. That's where I am now. Been stuck the past few days trying to rearrage what I have within the 2 pages.

Help, please!!

feyd | yar link be too long, shortened it to make display of page better, yar
beckwiga
Forum Newbie
Posts: 9
Joined: Wed Sep 21, 2005 7:45 pm

Can anyone help with this? I am still stuck on this.

Post by beckwiga »

Can anyone help with this? I am still stuck on this.
Post Reply