HTTP 301 response on authorization request?

 
  • HTTP 301 response on authorization request?

    I have this simple PHP code and am trying to just get my site to redirect to the authorization page...but I am consistently receiving an HTTP 301 response. This is the PHP code:


    $request_url = "http://www.last.fm/api/auth/?api_key=my_key_here";;
    $ch = curl_init($request_url);

    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_exec($ch);

    curl_close($ch);

    • tburny disse...
    • Forum Moderator
    • Mai 28 2012, 10h28
    Do you mean a 301 redirect?
    <?php
    header ("HTTP/1.1 301 Moved Permanently");
    header ("Location: http://www.last.fm/api/auth/?api_key=my_key_here";);
    exit();
    ?>

    Combo.fm: Combine your favourite radio stations! | My Blog | scala-lastfmapi | Cache2k - A high performance Java in-memory cache
    P.S.: Do not click here
    throw new PokemonException(); //Gotta catch 'em all
    My forum post reflects my personal opinion :)
  • [spam]

    [spam]

    Editado por bengt_bangt em Jun 12 2012, 13h31
Usuários anônimos não podem postar mensagens. É preciso fazer login ou criar uma conta para postar nos fóruns.