Military Loan - ID card - Debt Consolidation - Flash Games - Online Schooling

PDA

View Full Version : Auto submit form using php


PinoyIto
Sep 15th 2006, 1:42 am
Hello, how can I auto submit a form using php? I know this is posible in javascript but I am not sure with PHP. If can, will you please post a sample how to do it...

vdd
Sep 15th 2006, 3:02 am
It's possible and not too difficult. Use Curl library.

PinoyIto
Sep 15th 2006, 5:02 am
It's possible and not too difficult. Use Curl library.

Can you please show me some samples

vdd
Sep 15th 2006, 6:31 am
POST example:
<?
$url = 'http://localhost/curl/1.php';
$params = "keyword=123&zxczxc=333"; //you must know what you want to post
$user_agent = "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

$result=curl_exec ($ch);
curl_close ($ch);

echo "Results: <br>".$result;
?>

1.php (just for test)
<?
print_r($_POST);
?>

PinoyIto
Sep 16th 2006, 7:22 am
Thank you very much mate....

chirayu
Jun 5th 2008, 4:49 am
Hi PinoyITO,

I am looking for auto form fill up javascript code. I am looking for that. If any one can provide me, kindly contact me at chirayu.sbc@gmail.com

Thanks a lot in advance.