0

i have placed these code in my php file. i am getting some errors like,

Use of undefined constant To - assumed 'To' Use of undefined constant To - assumed 'Message' etc.

How do I declare the constants?

$sendsms =""; //initialise the sendsms variable
$param[To] = "0123456";
$param[Message] = "testmsg";
$param[UserName] = "user";
$param[Password] = "pwd";
$param[Mask] = "TTNERD";
$param[v] = "1.1"; 
$param[Type] = "Individual"
  • 2
    http://stackoverflow.com/questions/2941169/what-does-the-php-error-message-notice-use-of-undefined-constant-mean – Bruce Jan 17 '15 at 08:01

2 Answers2

1

Wrap those array keys in quotes:

$param[To] becomes $param['To']
Mike Purcell
  • 19,847
  • 10
  • 52
  • 89
1

Quote your array keys

$param['To'] = "0123456";
$param['Message'] = "testmsg";
$param['UserName'] = "user";
$param['Password'] = "pwd";
$param['Mask'] = "TTNERD";
$param['v'] = "1.1"; 
$param['Type'] = "Individual"
Bruce
  • 8,609
  • 8
  • 54
  • 83