Jump to content

curl


knutsford

Recommended Posts

I have this bit of curl code

            $email_url = "http://xxxxx/user_emails.php";
            $email_record = array(
                'form_name' => "network",
                'email' => trim($form_state['values']['email'])    
            );
            $curl_request = curl_init();
            curl_setopt($curl_request, CURLOPT_URL, $email_url);
            curl_setopt($curl_request, CURLOPT_POST, 1);
            curl_setopt($curl_request, CURLOPT_POSTFIELDS, $email_record);
            curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, true);            
                    
            $curl_response = curl_exec($curl_request);    
            echo "bbb";    
            echo $curl_response; 
            curl_close($curl_request);   

But it isn't working and I can't see why

 

 

http://xxxxx/user_emails.php exist and there are no error when I load it

 

It takes forever then the bbb gets echo'd but I don't get anything from echo $curl_response;

 even if all that is in http://xxxxx/user_emails.php is 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php

        echo "fail";
    
?>
</body>
</html>     

 Can someone see what is wrong please - thanks         
          

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.