문제

I try to login on Geoserver using php. i do:

$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;

But not see any activity in FireBug. I'm new with php, so maybe i do something wrong here? This code snipet i was found here.

도움이 되었습니까?

해결책

you won't see it in firebug cause firebug logs events that have place on your side (client) that mean in your browser. You could track this if you would use ajax then firebug would log it

If you want to check a track of it use tool to control your network for example WireShark. There you will be able to log this request

if you need to use login and password I would recomend you to use cURL. It is much better IMO

다른 팁

Can you try without port?? For example:

$geoserverURL = "http://localhost/geoserver/j_acegi_security_check";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top