Pergunta

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.

Foi útil?

Solução

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

Outras dicas

Can you try without port?? For example:

$geoserverURL = "http://localhost/geoserver/j_acegi_security_check";
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top