Search code examples
phpsms-gatewayhead

SMS sending in PHP ,without header() function


I am sending SMS from my bus ticketing site. The SMS can be send as follows :

header('Location: http://alerts.icisms.in/api/web2sms.php?workingkey=XXXXXX&sender=ABCD&to='.$number.'&message='.$message);

But I need to return to my own site.How can I accomplish this?


Solution

  • Use cURL or a simple file()/file_get_contents() call.

    //call
    $url = 'http://alerts.icisms.in/api/web2sms.php?workingkey=XXXXXX&sender=ABCD&to=' . $number . '&message=' . $message;
    
    //do call
    file($url);
    

    Then set your header location to your site.