svn commit: r640 - trunk/mapbender/http/extensions/geom2wfst.php

uli at osgeo.org uli at osgeo.org
Tue Jul 4 09:21:31 EDT 2006


Author: uli
Date: 2006-07-04 13:21:30+0000
New Revision: 640

Modified:
   trunk/mapbender/http/extensions/geom2wfst.php

Log:
change hardcoded url to dynamic url

Modified: trunk/mapbender/http/extensions/geom2wfst.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/extensions/geom2wfst.php?view=diff&rev=640&p1=trunk/mapbender/http/extensions/geom2wfst.php&p2=trunk/mapbender/http/extensions/geom2wfst.php&r1=639&r2=640
==============================================================================
--- trunk/mapbender/http/extensions/geom2wfst.php	(original)
+++ trunk/mapbender/http/extensions/geom2wfst.php	2006-07-04 13:21:30+0000
@@ -25,40 +25,29 @@
 <title>Test WFS-T operated by CCGIS</title>
 </head>
 <?php
-/*
-* 
-*/
-
-//echo $_REQUEST['url']."<br>";
-//echo stripslashes($_REQUEST['filter'])."<br>";
-//die;
-#$my = explode(" ",urldecode($_REQUEST["text"]));
-$host = "wms1.ccgis.de";
+$arURL = parse_url($_REQUEST["url"]);
+$host = $arURL["host"];
+$port = $arURL["port"]; 
+if($port == ''){
+	$port = 80;	
+}
+$path = $arURL["path"];
 $method = "POST";
-#$path = "/geoserver-1.3-beta4/wfs/Transaction?SERVICE=WFS&VERSION=1.0.0&TYPENAME=topp:mapbender_user&REQUEST=Transaction";
-#$path = "/geoserver/wfs/Transaction?SERVICE=WFS&VERSION=1.0.0";
-$path = "/geoserver/wfs/Transaction?";
 
-#$host = $_REQUEST["url"];
 $data = stripslashes($_REQUEST["filter"]);
-#echo $host.$data; die;
-$method = "POST";
 
-$out = sendToHost($host,$method,html_entity_decode($path),$data);
+$out = sendToHost($host,$port,$method,html_entity_decode($path),$data);
+
+
 echo $out;
-#echo "<br>".htmlspecialchars($out);
-function sendToHost($host,$method,$path,$data)
+function sendToHost($host,$port,$method,$path,$data)
 {
-#echo $host."<br>".$method."<br>".$path."<br>".htmlspecialchars($data)."<br>";		
 	$buf = '';
     if (empty($method)) {
         $method = 'POST';
     }
     $method = strtoupper($method);
-    $fp = fsockopen($host, 80);
-    if ($method == 'GET') {
-        $path .= '?' . $data;
-    }
+    $fp = fsockopen($host, $port);
     fputs($fp, "$method $path HTTP/1.1\r\n");
     fputs($fp, "Host: $host\r\n");
     fputs($fp,"Content-type: application/x-www-form-urlencoded\r\n");




More information about the Mapbender_commits mailing list