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
How to call javascript function in php without any event?
Explain what is meant by pear in php?
What is a persistent cookie in php?
How can I convert ereg expressions to preg in php?
What is basename php?
Is php coding easy?
How to get the IP address of the client/user in PHP?
What is artisan in php?
Tell me what are the different types of errors in php?
Write a program to display a table of any given number?
What is the difference between for and foreach?
What is get and post method in php?
List functions available to sort an php array?
Is php session id unique?
What is php array function?