打开外部URL并继续使用我自己的网页

Raj*_*ura 0 javascript php url

以下是我用于通过外部站点发送SMS的URL示例:

http://bulksms.poweredsms.com/send.php?usr=rajdeeps&pwd=pass123&ph=xxxxxxxxxxx&sndr=textid&text=hi

但是,如果我将用户重定向到此URL,则不会将其重定向回我的网站.但是我有代码执行/页面显示发送消息.

如何加载URL以发送消息而不会失去对显示给用户的内容的控制权?

MrC*_*ode 5

您需要在服务器端执行此操作,例如使用cURL.

    // create curl resource 
    $ch = curl_init(); 

    // set url 
    curl_setopt($ch, CURLOPT_URL, "http://bulksms.poweredsms.com/send.php?usr=rajdeeps&pwd=pass123&ph=xxxxxxxxxxx&sndr=textid&text=hi"); 

    //return the transfer as a string 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

    // $output contains the output string 
    $output = curl_exec($ch); 

    // close curl resource to free up system resources 
    curl_close($ch);

    // $output now contains the response from poweredsms.com
Run Code Online (Sandbox Code Playgroud)