This is bulk SMS sending code, and it works good and sends messages, but after sending a message, the web browser redirects me to code in a white page.
I want after sending a message to redirect to another page on my site.
$username = '';
$password = '';
$client = new SoapClient('http://www.xxxx/xx');
$numbers = 'xxxx ';
$message =
'hi this is a test
!@#$%^&*
';
$senderName = 'xxxxxx';
try {
$response = $client->sendSMS($username, $password, $numbers, $message, $senderName);
var_dump($response);
} catch(SoapFault $exception ) {
echo $exception->faultcode . ' : ' .$exception->faultstring . PHP_EOL;
}
Use this code
But remember that it won't work if there's any output already sent by php script. If so, you will get warning (check your error_reporting and display_errors in php.ini). So, in other words, you can't put it after var_dump because var_dump produces output. It might be also a good idea to put exit() after var_dump.