1

This code works fine on xampp localhost fine but does not work on the server host.

Any idea what might be wrong?

$contact_no = $_POST['contact_no'];
$message = $_POST['text_message'];
$message = urlencode($message);

$url = 'http://trsms.krispal.in/API/pushsms.aspx?username=xxxx&password=xxxx&senderid=MYDMAL&mobile='.$contact_no.'&text='.$message;
$xml = file_get_contents($url);
echo $xml;
echo "<script>alert('Message has been successfully send...')</script>";

1 Answers1

0

Check if your HOST disable file_get_contents function , Usually they disable it on shared host for security reasons. check server php configuration (php.ini) something like

allow_url_fopen=0
could broke file_get_contents functionality
B.Mossavari
  • 127
  • 6