Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = "https://www.xxx.xxx";
- $post = "";# all data that going to send
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0');
- $exe = curl_exec($ch);
- $getInfo = curl_getinfo($ch);
- if ($exe === false) {
- $output = "Error in sending";
- if (curl_error($ch)){
- $output .= "n". curl_error($ch);
- }
- } else if($getInfo['http_code'] != 777){
- $output = "No data returned. Error: " . $getInfo['http_code'];
- if (curl_error($ch)){
- $output .= "n". curl_error($ch);
- }
- }
- curl_close($ch);
- echo $output;
- $url = "https://www.xxx.xxx";
- $post = "";# all data that going to send
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0');
- $exe = curl_exec($ch);
- $getInfo = curl_getinfo($ch);
- if ($exe === false) {
- $output = "Error in sending";
- if (curl_error($ch)){
- $output .= "n". curl_error($ch);
- }
- } else if($geInfo['http_code'] != 777){ //here $geInfo should be $getInfo
- $output = "No data returned. Error: " . $geInfo['http_code'];//as preline
- if (curl_error($ch)){
- $output .= "n". curl_error($ch);
- }
- }
- curl_close($c); //$c should be $ch
- echo $output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement