Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: curl a form

  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    116
    Thanks
    11
    Thanked 4 Times in 4 Posts

    curl a form

    I want to curl a form to check the status of a messenger account how would I curl the data to the form and display the result

    The site is http://www.blockstatus.com/aim/status-checker/ I used tamper data to see how it submits the postdata as you can see below

    POSTDATA=aimac=screenname&submit=Submit
    Last edited by The_Return; 10-10-2009 at 03:54 AM.

  • #2
    Regular Coder
    Join Date
    Dec 2008
    Posts
    116
    Thanks
    11
    Thanked 4 Times in 4 Posts
    ok now I got the curl part done but can't get the preg_match so it only displays offline or online

    PHP Code:
    <?php
    $url 
    "http://www.blockstatus.com/aim/status-checker/index.php";
    $ch curl_init();

    curl_setopt($chCURLOPT_URL,$url);

    curl_setopt($chCURLOPT_POST1);

    curl_setopt($chCURLOPT_POSTFIELDS,"aimac=screenname");

    curl_setopt ($chCURLOPT_RETURNTRANSFER1);

    $result curl_exec ($ch);
    curl_close ($ch);

    $data $result;

    $pattern '/<b.*?>Status:(.*?)<\/b>/i';

    preg_match($pattern$data$status);
    echo 
    "$status[0]";

    ?>
    and it displays:

    Code:
    AIM Screen Name: screenname
    Status:


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •