Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

[need help] cURL post data

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

[need help] cURL post data

Postby dangnghia » Mon Sep 17, 2012 3:01 am

1 : <form action="viet.php" method="POST">
2 : Tên : <br/>
3 : <input type="text" name="ten"> <br/>
4 : Giới tính : <input type="radio" vulaue="0" name="gt"> Con trai <input type="radio" vulaue="1" name="gt"> Con gái <br/>
5 : Nội dung : <br/>
6 : <input type="text" name="nd"> <br/>
7 : <input type="submit" value="Gửi" name="submit"> <br/> </form>
cURL , error , pro edit help me !!!!!
$url = 'http://aa/test.php';
$referer = 'http://aa/test.php';
$post_fields = "gt=$gt&sdt=$ten&nd=$noidung";
$data = array(
'gt'=>"$gt",
'ten'=>"$ten",
'nd'=>"$noidung",
'submit'=>"Gửi",
);
$post = http_build_query($data);
$ua = "Nokia6300/2.0 (07.00) Profile/MIDP-2.0 Configuration/CLDC-1.1 Mozilla/5.0 (Java; U; vi; nokia6300) UCBrowser8.2.0.132/70/452/UCWEBMobile";
$ch = curl_init($url);
curl_setopt($ch , CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($ch);
curl_close($ch);
dangnghia
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Sep 17, 2012 2:48 am

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron