How to Post to .aspx using Curl in php
Collapse
X
-
PHP Code:$url = 'your url goes here';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Connection: Close'));
$contents = curl_exec($ch);
curl_close($ch);
echo $contents;
Leave a comment:
-
my host doesnot file_get_contents. Can u please provide the curl code.
Leave a comment:
-
i think you dont even need to send a post request a simple get would work too:Originally posted by sabin14 View Post
PHP Code:$url = 'your url goes here';
$contents = file_get_contents();
echo $contents;
Leave a comment:
-
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?Tags: None
Leave a comment: