• Koder 03/06/2009

    Interessant kode, der gør brug af PHP og webadressen til at få PageRank på et websted. Husk at have installeret og aktiveret den libcurl biblioteket.

    function Curl ($ url, $ header, $ cookie, $ p)
    (
    $ Ch = curl_init ();
    curl_setopt ($ ch, CURLOPT_HEADER, $ header);
    curl_setopt ($ ch, CURLOPT_NOBODY, $ header);
    curl_setopt ($ ch, CURLOPT_URL, $ url);
    curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt ($ ch, CURLOPT_COOKIE, $ cookie);
    curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);
    if ($ p) (
    curl_setopt ($ ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt ($ ch, CURLOPT_POST, 1);
    curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ p);
    )
    ;
    $ Result = curl_exec ($ ch);
    curl_close ($ ch);
    if ($ result) (
    return $ result;
    ) Else (
    curl_error return ($ ch);
    )
    ;
    )
    ;
    if (isset ($ _GET [ 'url']))
    (
    $ Rank = Curl ( "http://dlls.info/results.php?url =".$_ GET [ 'url'], 0,0, null);
    echo $ rank;
    echo "
    <form method=get target=rank.php>
    URL: <input type=text name=url> <input type=submit value=Submit>
    ";
    )
    anden
    (
    ?>
    <form method=get target=rank.php>
    URL: <input type=text name=url>
    <input type=submit value=Submit>
    <?
    )
    ?>

    Relaterede stillinger med Miniaturer
    Del denne artikel:
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google Bookmarks
    • BarraPunto
    • Meneame
    • Bitacoras.com
    • Technorati
    • Blogosphere News
    • Live
    • Yahoo! Bookmarks

    Onsdag 3 juni, 2009

  • Efterlad en kommentar

    Bemærk venligst: Kommentar moderation er aktiveret og kan forsinke din kommentar. Der er ingen grund til at sende din kommentar.

Translator

Vores besøgende

  • 277.723 Besøgende

Besøgende

    free counters

Fællesskabet


Annonce


**************************************** ******** Page Rank **************************************-->