Quantcast
Viewing latest article 1
Browse Latest Browse All 3

Answer by Shivendra Singh for How to submit retrieve a form from URL and submit it using PHP?

Maybe the issue is you are sending post field value in an array instead of URL encoded, use http_build_query or json_encode and check.

Check the below code.

if(!empty($_POST)){        echo "<pre>";        print_r($_POST);        echo "</pre>";        $ch = curl_init();        curl_setopt($ch, CURLOPT_URL, $url);        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);        curl_setopt($ch, CURLOPT_POST, true);        $data = $_POST;        /*** you are direct sending the array value         use http_build_query         or         $data_string = json_encode($data);        ***/        $data_string = http_build_query($data);        curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string );        $out = curl_exec($ch);        $inf = curl_getinfo($ch);        curl_close($ch);        echo "<pre>";        print_r($out);        print_r($inf);        echo "</pre>";        exit;      }

Viewing latest article 1
Browse Latest Browse All 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>