Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6103229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:42:19+00:00 2026-05-23T13:42:19+00:00

The function: function post_with_curl($target,$ref, $name ,$viewStateValue ) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target)

  • 0

The function:

function post_with_curl($target,$ref, $name ,$viewStateValue )
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $target) ;       // Target site

        curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/', getcwd().'/'."cook.txt" )); //CHANGE THIS 
        curl_setopt($ch, CURLOPT_REFERER, $ref);  
        curl_setopt($ch, CURLOPT_TIMEOUT, CURL_TIMEOUT);    // Timeout
        curl_setopt($ch, CURLOPT_USERAGENT, WEBBOT_NAME); 
        curl_setopt ($ch, CURLOPT_POST, 1);


        $postfields = urlencode('__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=.'. $viewStateValue. '&__VIEWSTATEENCRYPTED=&ctl00$ContentPlaceHolder1$NameSearch1$CompanyNameTextBox1='.$name.'&ctl00$ContentPlaceHolder1$SearchButton=Search Now' ) ;
        curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields );

        curl_setopt($ch, CURLOPT_HEADER, 1);
        curl_setopt($ch, CURLINFO_HEADER_OUT, true);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);     // Follow redirects
        curl_setopt($ch, CURLOPT_MAXREDIRS, 4);             // Limit redirections to four
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);     // Return in string  
        $curled_page = curl_exec($ch);
        var_dump(curl_getinfo($ch , CURLINFO_HEADER_OUT)) ;
        curl_close($ch);
        return $curled_page ;
    }

The result of var_dump(curl_getinfo($ch , CURLINFO_HEADER_OUT)) :

string 'POST /V2/COUNTY/Default.aspx HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Host: 198.173.15.31
Accept: */*
Referer: http://198.173.15.31/V2/COUNTY/
Cookie: ASP.NET_SessionId=pqfpur45akgy3l45ujq3fail
Content-Length: 1603
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

' (length=339)

As I see it, the header(being sent by curl?) does not contain any POST data. Why ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:42:19+00:00Added an answer on May 23, 2026 at 1:42 pm

    That’s because post data is not part of the headers of a HTTP message, but part of the HTTP message body. If you get the headers, you don’t get the body. If you want to retrieve the body you must retrieve the message body.

    BTW you don’t need to retrieve it because you already created it on your own into the $postfields variable. That’s merely the data being posted.

    Or did I misread what you’re actually asking for?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My site uses a php function to tweet an update whenever an event occurs.
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
I'm trying to post a JavaScript data object with the following: $.post(frm.attr(action), data, function(res)
I use jquery post function to go to server and bring the link to
I have a jQuery post function that returns a response on success after the
my ajax is : $('#save').click(function(){ $.post(http://127.0.0.1:8080/sss, function(data){ alert(data); }); }) and the django view
Lets say for example: $(.button).click(function() { $.post(commandrunner.php, { param1: 'value', param2: 'value2', param3: 'value3'
I was wondering if I could do pre/post function call in C++ somehow. I
I have written a form using the jQuery .post() function to post the data
quick question, is it secure to use the jQuery.post function in jQuery to pass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.