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 are the difference between overloading and overriding in oops?

1026


How to remove the new line character from the end of a text line in php?

976


Which library is used in php to do various types of image work?

994


What is the difference between javascript and php?

1033


What is null value in php?

1044


How would you open a directory for reading in php?

1017


Will react hooks replace redux?

965


Tell us how can we access the data sent through the url with the post method?

994


What is encapsulation in php?

980


What is variable function php?

1053


List the different types of print functions available in php?

922


What is faster in php?

1058


Write a program to show the joining of two strings in php?

955


How error handling is being handled by php?

1060


Is it possible to destroy a cookie?

983