我尝试使用 php 登录 Geoserver。我做:
$geoserverURL = "http://localhost:8080/geoserver/j_acegi_security_check";
$post = http_build_query(array(
"username" => $username,
"password" => $password,
));
$context = stream_context_create(array("http"=>array(
"method" => "POST",
"header" => "Content-Type: application/x-www-form-urlencoded\r\n" .
"Content-Length: ". strlen($post) . "\r\n",
"content" => $post,
)));
$page = file_get_contents($geoserverURL, false, $context);
echo $page;
但在 FireBug 中看不到任何活动。我是 php 新手,所以也许我在这里做错了什么?我在这里找到了这段代码。