Вот основной скрипт cURL POST. Он не обрабатывает ошибки - вам определенно следует прочитать руководство по cURL .
<?php
// Destination URL
$url = 'http://ubaid.tk/sms/sms.aspx';
// Raw data to send
$fields = array(
'uid' => $_GET['uid'],
'phone'=>$_GET['phone'],
'pwd'=>$_GET['pwd'],
'msg'=>$_GET['msg'],
'provider'=>'way2sms'
);
// Build $fields into an encoded string
$body = http_build_query($fields);
// Initialise cURL
$ch = curl_init($url);
// Set options (post request, return body from exec)
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
// Do the request
$result = curl_exec($ch);
// Echo the result
echo $result;
EDIT
Поскольку на самом деле вам нужен GET, а не POST, код становится намного проще:
<?php
// Destination URL
$url = 'http://ubaid.tk/sms/sms.aspx';
// Raw data to send
$fields = array(
'uid' => $_GET['uid'],
'phone'=>$_GET['phone'],
'pwd'=>$_GET['pwd'],
'msg'=>$_GET['msg'],
'provider'=>'way2sms'
);
// Build $fields into an encoded string and append to URL
$url .= '?'.http_build_query($fields);
// Initialise cURL
$ch = curl_init($url);
// Set options (post request, return body from exec)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
// Do the request
$result = curl_exec($ch);
// Echo the result
echo $result;
... или все это можно сделать без cURL как:
<?php
// Destination URL
$url = 'http://ubaid.tk/sms/sms.aspx';
// Raw data to send
$fields = array(
'uid' => $_GET['uid'],
'phone'=>$_GET['phone'],
'pwd'=>$_GET['pwd'],
'msg'=>$_GET['msg'],
'provider'=>'way2sms'
);
// Build $fields into an encoded string and append to URL
$url .= '?'.http_build_query($fields);
// Do the request
$result = file_get_contents($url);
// Echo the result
echo $result;