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

Why ide is recommended for use while programming with php?

975


What are php keywords?

984


Explain Booleans in PHP?

1130


Which function is used to strip whitespace?

1015


How many days will it take to learn php?

1107


What is input sanitization in php?

1017


What is the use of mysql_real_escape_string in php?

954


Is array a key php?

1016


What is pdo classes?

1206


Why print_r is used in php?

994


What the use of var_dump()?

1097


Who is the father of php and what is the current version of php and mysql?

1408


What is the use of imagetypes() method?

1025


What is php7?

1136


Explain a resource?

1071