The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 2 of 2

Thread: PHP - curl & posting (and sending the user) to a page

  1. #1

    PHP - curl & posting (and sending the user) to a page

    Hi peoples,

    I'm trying to find some information on php and the curl library, but am not having much finding what I'm after.

    What I need a script to do is load up, grab some information in a database and post this information to a url, but actually follow the url, so if im posting var1 to the url, it would be as if I had a html form that posted to that url.

    Does anyone have any ideas? :/


  2. #2
    Something like this:


    $posting = curl_init( "http://the.url.of.the/receiving/script.asp" ); //can be obtained from the source code of the page with the form

    curl_setopt( $posting, CURLOPT_POST, true );
    curl_setopt( $posting, CURLOPT_POSTFIELDS, "field1=Value&field2=One%20more%20value&field3=123 45" ); // form data encoded the same way as a browser would encode it (it's called application/x-www-form-urlencoded)

    curl_exec( $posting ); // cURL sends data to the script and prints output

    curl_close( $posting );


    Many more cURL options can be found at

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012