What breaks this code from PHP 5.2 to 5.4
<?php
$values = '';
foreach($_REQUEST as $key => $val) {
$values .= $key.'='.$val.'&';
}
$url = 'https://someurl.com';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $values);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
echo ($response);
?>
Something is breaking this code between PHP 5.2 and 5.4, I'm not entirely
sure what. I've been able to verify that the request variables exist, and
that values is correct after the foreach loop. However it appears the
issue is with the CURL , as the response does not echo. I receive no
errors, and nothing is returned as if the curl does not return a response.
No comments:
Post a Comment