slowfamily Posted March 25, 2009 Share Posted March 25, 2009 Hello there, I've been searching for a while but can't seem to find any similar mention to my problem. I have a small script that uses curl to post a name and email address submitted on a form on one site to an email marketing service for newsletter optins: function sendSubscription ($url,$params) { $ch = curl_init ($url) ; curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE) ; curl_setopt ($ch, CURLOPT_POST, TRUE) ; curl_setopt ($ch, CURLOPT_POSTFIELDS, $params) ; $res = curl_exec ($ch) ; curl_close ($ch) ; return ($res) ; } I am almost certain it previously was working, but now the response received in curl from the site I'm submitting to is 'invalid request'. Despite the fact that the code I am using primarily came from this company's website, they have told me they do not support php code or curl. Interestingly, if I run the EXACT same script on another server, both of which are running the same version of Red Hat Linux, and both compiled with libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6, then the script runs successfully. The only obvious difference I see (I'm sure there's more) is that the server that it works on is running php 5.2.8, while the one that it is not working is 5.2.6. Has anyone else experienced anything like this? Are there any other contributing factors that could cause this to happen, or could it just be the version difference? Possibly there's something else I'm overlooking.. Thanks! Link to comment https://forums.phpfreaks.com/topic/151097-curl-acting-different-on-different-servers/ Share on other sites More sharing options...
slowfamily Posted March 26, 2009 Author Share Posted March 26, 2009 I guess no one's heard of anything like this? I'll admit I'm being pretty vague with the situation, but it really is making just no sense to me. Link to comment https://forums.phpfreaks.com/topic/151097-curl-acting-different-on-different-servers/#findComment-794587 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.