Locate.php not always returning results

Post Reply
User avatar
ACalcutt
Vistumbler / TechIdiots Admin
Vistumbler / TechIdiots Admin
Posts: 1302
Joined: Sun Oct 21, 2007 6:50 pm
Location: Rutland, MA
Contact:

Locate.php not always returning results

Post by ACalcutt »

I noticed today that Locate.php does not seem to be working right.

When i access it from Vistumbler using (Extra --Locate position in WiFiDB) I am getting the error "Try feeding me some valid data and not that crap that you just tried."

This is my test url
http://www.vistumbler.net/wifidb/opt/lo ... 2:6A:60|73

It seems like it is trying to create the timezone cookie, then not passing the data back to the script because when I look at the webpage being returned to vistumbler in Auto WiFiDB Gps Locate I am only getting your timezone javascript

Code: Select all

		<script type="text/javascript">
		function checkTimeZone()
		{
			var expiredays = 31536000;
			var rightNow = new Date();
			var date1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
			var date2 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
			var temp = date1.toGMTString();
			var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
			var temp = date2.toGMTString();
			var date4 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
			var hoursDiffStdTime = (date1 - date3) / (1000 * 60 * 60);
			var hoursDiffDaylightTime = (date2 - date4) / (1000 * 60 * 60);
			if (hoursDiffDaylightTime == hoursDiffStdTime) 
			{ 
				var exdate=new Date();
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_dst" + "=" +escape("0")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
				
				var expiredays = 3600;
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_check" + "=" +escape("1")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
			}
			else
			{
				var exdate=new Date();
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_dst" + "=" +escape("1")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
				
				var expiredays = 3600;
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_check" + "=" +escape("1")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		   }
		   location.href = '/wifidb/opt/locate.php';
		}
		</script>
		<body onload = "checkTimeZone();" ></body>
		
		<script type="text/javascript">
		function checkTimeZone()
		{
			var expiredays = 31536000;
			var rightNow = new Date();
			var date1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
			var date2 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
			var temp = date1.toGMTString();
			var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
			var temp = date2.toGMTString();
			var date4 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
			var hoursDiffStdTime = (date1 - date3) / (1000 * 60 * 60);
			var hoursDiffDaylightTime = (date2 - date4) / (1000 * 60 * 60);
			if (hoursDiffDaylightTime == hoursDiffStdTime) 
			{ 
				var exdate=new Date();
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_dst" + "=" +escape("0")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
				
				var expiredays = 3600;
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_check" + "=" +escape("1")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
			}
			else
			{
				var exdate=new Date();
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_dst" + "=" +escape("1")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
				
				var expiredays = 3600;
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie="wifidb_client_check" + "=" +escape("1")+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		   }
		   location.href = '/wifidb/opt/locate.php';
		}
		</script>
		<body onload = "checkTimeZone();" ></body>
Post Reply