<?php
function get_url($url, $timeout = 10) {
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
class Post {
var $updateUrl = 'http://api.logicmelon.com/AddAdvert';
$url = $file_name;
$fields = array(
'__VIEWSTATE'=>urlencode($state),
'__EVENTVALIDATION'=>urlencode($valid),
'btnSubmit'=>urlencode('Submit')
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); # required for https urls
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
$response = curl_getinfo($ch);
curl_close($ch);
$result = curl_exec($ch);
print $result;
}
}
?>
我正在尝试发布数据,但我不确定这是如何工作的,有些人可以帮助我,以便我可以将数据从我的文本字段发送到他们的网站,以便它提交我给出的详细信息