Location: PHPKode > projects > Wiki-Map > htdocs/addpt.php
<?
	require_once('openDB.php');
	$desc = addslashes($_POST[desc]);
	$sql = "INSERT INTO `waypoints` ( `s_desc` , `m_desc` , `l_desc` , `type` , "
				."`importance` , `zlevel` , `valid_from` , `valid_upto` , `longitude` , `latitude` , "				."`datum` , `ellipsoid` , `contributor` , `ipaddr` , `datestamp` , `remarks` )"
				." VALUES ("
				."'$desc', '$desc', '$desc', '$_POST[type]', '$_POST[importance]',"
				."'$_POST[z]',NOW(), '9999-12-31', '$_POST[lng]', '$_POST[lat]', 'WGS84', '0',"
				."'$_COOKIE[login]', '$_SERVER[REMOTE_ADDR]', NOW( ) , '-');";
	$_COOKIE[x] = $_POST[lat];
	$_COOKIE[y] = $_POST[lng];
	$_COOKIE[z] = $_POST[z];

	//$sql = "INSERT INTO waypoint () VALUES ()";
	$result = mysql_query($sql);
	
	if (!$result){
			echo '** Creation falied ** '.mysql_error().'<BR>\n';
	} else {
		header("Cache-Control:no-cache");
		$go = "/?edit=1&a=Data+updated";
		header("Location:".$go);
		exit();
	}
/*

Google uses WGS84

Datum:
<select name=datum default=0>
<option value='0'> - Select - </option>;
<option value='NA'> - Do not know - </option>;
<option value=\'	AIRY	'>	Airy 1830	</option>
<option value=\'	MAIRY	'>	Modified Airy	</option>
<option value=\'	AUNAT	'>	Australian National	</option>
<option value=\'	NAMB	'>	Bessel 1841 (Namibia)	</option>
<option value=\'	BESSEL	'>	Bessel 1841  	</option>
<option value=\'	CLARKE41	'>	Clarke 1866	</option>
<option value=\'	CLARKE80	'>	Clarke 1880	</option>
<option value=\'	EVST30	'>	Everest (India 1830)	</option>
<option value=\'	EVST30	'>	Everest (Sabah Sarawak)   	</option>
<option value=\'	EVST56	'>	Everest (India 1956)  	</option>
<option value=\'	EVST69	'>	Everest (Malaysia 1969)   	</option>
<option value=\'	EVSTMY	'>	Everest (Malay. & Sing)   	</option>
<option value=\'	EVSTPK	'>	Everest (Pakistan)  	</option>
<option value=\'	FISC60	'>	Modified Fischer 1960  	</option>
<option value=\'	HELM06	'>	Helmert 1906 	</option>
<option value=\'	HUGH60	'>	Hough 1960 	</option>
<option value=\'	INDO74	'>	Indonesian 1974 	</option>
<option value=\'	INTL24	'>	International 1924  	</option>
<option value=\'	KRAS40	'>	Krassovsky 1940 	</option>
<option value=\'	GRS80	'>	GRS 80 	</option>
<option value=\'	SAM69	'>	South American 1969  	</option>
<option value=\'	WGS72	'>	WGS 72 	</option>
<option value=\'	WGS84	'>	WGS 84 	</option>
*/
?>
Return current item: Wiki-Map