اگه کسی باشه کمک کنه من هنوزم منتظرما
تو سایتای فارسی گشتم با curl که خوب توضیح نداده بودن
درضمن اگه زحمتی نیست بتونید کدش رو برام اینجا بزارید واقعا واقعا ممنون میشم.
به سرور test.com وضل بشه
پنج متغیر data1 و data2 و data3 و data4 و data5 با مقادیر value1 و value2 و value3 و value4 و value5 بفرسته
بصورت post
با soap امتحان کردم فکر کنم یه چیزی تو مایه های XML میخواد یا یه همچین چیزی
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.test.com/' : Premature end of data in tag html line 2 in /home/a329****/public_html/datasend.php:7 Stack trace: #0 /home/a329****/public_html/datasend.php(7): SoapClient->SoapClient('http://www.test...') #1 {main} thrown in /home/a329****/public_html/datasend.php on line 7
یه کد بصورت socket دارم که نمیدونم پشتیبانی میشه یا نه خودم هم سر در نمیارم اگه میشه یکی بگه و اگه شد کدش رو بصورت درخواستی که بالا دادم خواهشا تغییر بده ممنون میشم.
<?php
$url = $_POST['url'];
$referer=$_Post['referer'];
$_data = $_POST['data'];
function PostRequest($url, $referer, $_data) {
$data = array();
while(list($n,$v) = each($_data)){ $data[] = "$n=$v"; }
$data = implode('&', $data);
$url = parse_url($url);
if ($url['scheme'] != 'http') { die('Only HTTP request are supported !'); }
$host = $url['host'];
$path = $url['path'];
$fp = fsockopen($host, 80);
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Referer: $referer\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ". strlen($data) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
/*
$result = '';
while(!feof($fp)) {
// receive the results of the request
$result .= fgets($fp, 128);
}
*/
// close the socket connection:
fclose($fp);
// split the result header from the content
//$result = explode("\r\n\r\n", $result, 2);
//$header = isset($result[0]) ? $result[0] : '';
//$content = isset($result[1]) ? $result[1] : '';
// return as array:
//return array($header, $content);
}
/*
** The example:
*/
// submit these variables to the server:
$data = array(
'test' => 'foobar',
'okay' => 'yes',
'number' => 2
);
// send a request to example.com (referer = jonasjohn.de)
list($header, $content) = PostRequest(
"http://www.example.com/",
"http://www.jonasjohn.de/",
$data
);
// print the result of the whole request:
//print $content;
// print $header; --> prints the headers
?>منبع: How to do a POST request (
http://www.jonasjohn.de/snippets/php/post-request.htm)
واقعا ممنون میشم