Post by satish11nov » Mon Feb 04, 2013 11:01 pm

Hi Friends,

I want to send SMS to customer when they register on site. Hence i have added a code that sends cURL request with some parameters to SMS server.

I have added this code in Model > customer.php file >addcustomer() method and just before the line used to send email to admin.

When i try to register, it adds customer,send mail and sms to customer and send mail to admin but instead of success message , it shows the errors on screen as

Notice: Use of undefined constant username - assumed 'username' in /home/content/17/10209417/html/catalog/model/account/customer.php on line 52Notice: Use of undefined constant password - assumed 'password' in /home/content/17/10209417/html/catalog/model/account/customer.php on line 53Notice: Use of undefined constant to - assumed 'to' in /home/content/17/10209417/html/catalog/model/account/customer.php on line 54Notice: Use of undefined constant sender - assumed 'sender' in /home/content/17/10209417/html/catalog/model/account/customer.php on line 55Notice: Use of undefined constant message - assumed 'message' in /home/content/17/10209417/html/catalog/model/account/customer.php on line 56Message GID=228334610 ID=228334610-1(SUBMITED)Warning: Cannot modify header information - headers already sent by (output started at /home/content/17/10209417/html/index.php:103) in /home/content/17/10209417/html/vqmod/vqcache/vq2-system_engine_controller.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/content/17/10209417/html/index.php:103) in /home/content/17/10209417/html/vqmod/vqcache/vq2-system_engine_controller.php on line 29

Below is the code i have used.

try
{
$curl = curl_init();
// Set some options -
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://xyz.com/sms.php',
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => array(
username => 'XXXX',
password => 'XXXX',
to =>$data['telephone'],
sender=> 'XXXX',
message => 'Hello'
)
));
// Send the request & save response to $resp
$resp = curl_exec($curl);


}catch( Exception $e)
{
//no error message
}
// Close request to clear up some resources
curl_close($curl);


Please help me to resolve this error

Newbie

Posts

Joined
Fri Nov 30, 2012 6:14 pm
Who is online

Users browsing this forum: No registered users and 128 guests