Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Without using forms and hidden variables, how to send
variables from a PHP script to another URL using POST
method?

Answer Posted / lakhan lal

you can do it using curl

example:

<?
$URL="www.mysite.com/test.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://$URL");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,
CURLOPT_POSTFIELDS, "Data1=blah&Data2=blah");curl_exec
($ch);
curl_close ($ch);
?>

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is include in php?

934


What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?

1101


What is Type hinting in PHP?

1134


How I can control asset documents without GR/IR?

1610


When a conditional statement is ended with an endif?

924


What is the default session out time?

1070


How to receive a cookie from the browser?

1104


What is the difference between query and inquiry?

894


What is the use of header() function in PHP? What the Limitation of HEADER()?

1023


What is symfony php?

937


Why namespace is used in php?

971


What is difference between php and wordpress?

1114


What is strcmp?

943


What does the initials of php stand for?

939


What is warning – “cannot modify header information – headers already sent”?

1056