johnnybenimble Posted September 27, 2010 Share Posted September 27, 2010 Hi, I am trying to post to a REST service using PHP cURL but I'm after running into a bit of difficulty (this being that I've never used cURL before!!). I've put together this code: $url = 'http://127.0.0.1:00/AccountCreator.ashx'; /*Where :00 represents the port number */$curl_post_data = array( 'companyName' =>urlencode($companyName), 'mainContact' =>urlencode($mainContact), 'telephone1' =>urlencode($telephone1), 'email' => urlencode($email), 'contact2' => urlencode($contact2), 'telephone2' => urlencode($telephone2) 'email2' => urlencode($email2); 'package' => urlencode($package) );foreach($curl_post_data as $key=>$value) {$fields_string .=$key. '=' .$value.'&';}rtrim($fields_string, '&');$ch = curl_init();curl_setopt ($ch, CURLOPT, $url);curl_setopt ($ch, CURLOPT_POST, count($curl_post_data));curl_setopt ($ch, CURLOPT_POSTFIELDS, $fields_string);$result = curl_exec($ch);curl_close($ch); I've tried this however it doesn't run. As I am integrating with payment partners, it just says: Your transaction has been successful but there was a problem connecting back to the merchant's web site. Please contact the merchant and advise them that you received this error message. Thank you. I have emailed them to find out the exact error, but in the mean time I was wondering could someone take a look at my code to eliminate this as a problem, if possible. Thanks. Quote Link to comment Share on other sites More sharing options...
johnnybenimble Posted September 27, 2010 Author Share Posted September 27, 2010 I've just got word from our payment partners, the error was a HTTP 500 error. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.