<?php
header("Location:http://www.perfectbulksms.in/Sendsmsapi.aspx
USERID=namePASSWORD=pass&SENDERID=id&TO=$phn&MESSAGE=$sms");
header("Location:password.php?msg=new");
?>
I want to send sms through php code. it is working fine but the problem is i have to use two headers one for the sms and another for to redirect my page on the location i want. but only the second one is working. and i also want to hide the detail of my sms code when it url in the tab. and want to use both sms and redirect. please help?????
header("Location: ..."); is use to redirect user to another page. Think logically how can you redirect user on 2 pages at the same time.
As I can see you want to make an API Call to perfectbulksms.in to Send SMS I would highly suggest to use CURL to do so and then use header
$ch = curl_init("http://www.perfectbulksms.in/Sendsmsapi.aspxUSERID=namePASSWORD=pass&SENDERID=id&TO=$phn&MESSAGE=$sms");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
$result = curl_exec($ch);
curl_close($ch);
header("Location:password.php?msg=new");
this is a basic example, Read more about CURL http://php.net/manual/en/book.curl.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With