I have the following code:
$fields = array('usuario'=>urlencode($jm->Login),'senha'=>$jm->Senha);//url-ify the data for the POST
$fields_string = '';
foreach($fields as $key=>$value) {
$fields_string .= $key.'='.$value.'&'; }
$url = "https://www.sitecliente.com.br/validar/";
$ch = curl_init();//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);//execute post
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$result = curl_exec($ch);//close connection
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo "STATUS: ";
print_r($status);
curl_close($ch);
The goal is to click on a link within our system, to be directed to an external system. When we do this, it validates, but the page goes blank. When giving a print in status, it returns the message: STATUS: 303.
I noticed that this error can be because we are using POST and should use GET. How would I do that?