Hello. I am just about there, but getting a 500 server error when trying to send out the URL with CURL. I do have CURLSSL installed on the server and the rest of the script appears to check out codewise. I have it narrowed down to when my CURL function is being called. Didn't see a matching error in my Apache logs but perhaps I'm looking in the wrong spot.
PHP Code:
<?php
class orderNotifier extends base {
function orderNotifier() {
$this->attach($this, array('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL'));
}
function update(&$Class, $notifier, $paramsArray) {
$num = $paramsArray[0];
$cust = $Class->customer;
$country = urlencode($cust['country']['title']);
foreach ($cust as $k => $v)
if (!is_array($k))
$cust[$k] = urlencode($v);
$inf = $Class->info;
if ($inf['order_status'] == 1) {
foreach($Class->products as $prod) {
$url = 'http://www.mystore.com/blabla.php?num=' . $num . '&firstname=' . $cust['firstname'] . '&lastname=' . $cust['lastname'] . '&email=' . $cust['email_address'] . '&company=' . $cust['company'] . '&address=' . $cust['street_address'] . '&city=' . $cust['city'] . '&state=' . $cust['state'] . '&postcode=' . $cust['postcode'] . '&country=' . $country . '&telephone=' . $cust['telephone'] . '&qty=' . $prod['qty'] . '&prod_name=' . urlencode($prod['name']) . '&id=' . $prod['id'];
submit_form($url);
}
}
}
function submit_form($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_INTERFACE, 'my_ip');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
}
}
?>
Bookmarks