knutsford Posted November 4, 2017 Share Posted November 4, 2017 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 More sharing options...
requinix Posted November 5, 2017 Share Posted November 5, 2017 Sounds like it's timing out. curl_error Link to comment Share on other sites More sharing options...
phpmillion Posted November 5, 2017 Share Posted November 5, 2017 Can you see some response if you use another URL for debugging purposes? Like Google.com, or something? Link to comment Share on other sites More sharing options...
requinix Posted November 5, 2017 Share Posted November 5, 2017 You should be able to get something. What it is depends on the site. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.