How to Post to .aspx using Curl in php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Post to .aspx using Curl in php

    I want to post to .aspx using php in curl. The site does not require cookie.
    I tried as normal curl positng and It didnt post. can anyone provide me the code?

    #2
    Originally posted by sabin14 View Post
    I want to post to .aspx using php in curl. The site does not require cookie.
    I tried as normal curl positng and It didnt post. can anyone provide me the code?
    the same way like you post to php using php curl
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      I Tried . but it is not posting .

      [url]http://mysite.com/example.aspx
      I want to post in this fashion


      I should get +1 as the result on screen for posting

      please help
      Last edited by sabin14; 08.01.12, 12:46.

      Comment


        #4
        Originally posted by sabin14 View Post
        I Tried . but it is not posting .


        I want to post in this fashion


        I should get +1 as the result on screen for posting

        please help
        i think you dont even need to send a post request a simple get would work too:
        PHP Code:
        $url 'your url goes here';
        $contents file_get_contents();
        echo 
        $contents
        Advertise your mobile site for FREE with AdTwirl

        Comment


          #5
          my host doesnot file_get_contents. Can u please provide the curl code.

          Comment


            #6
            PHP Code:
            $url 'your url goes here';
            $ch curl_init();
            curl_setopt($chCURLOPT_URL$url);
            curl_setopt($chCURLOPT_RETURNTRANSFER1);
            curl_setopt($chCURLOPT_TIMEOUT5);
            curl_setopt($chCURLOPT_CONNECTTIMEOUT5); 
            curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_0);
            curl_setopt($chCURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded''Connection: Close'));       
            $contents curl_exec($ch);
            curl_close($ch);
            echo 
            $contents
            Advertise your mobile site for FREE with AdTwirl

            Comment


              #7
              Thank u very much. It worked.
              Last edited by sabin14; 08.01.12, 13:05.

              Comment

              Working...
              X