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
What is include in php?
What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?
What is Type hinting in PHP?
How I can control asset documents without GR/IR?
When a conditional statement is ended with an endif?
What is the default session out time?
How to receive a cookie from the browser?
What is the difference between query and inquiry?
What is the use of header() function in PHP? What the Limitation of HEADER()?
What is symfony php?
Why namespace is used in php?
What is difference between php and wordpress?
What is strcmp?
What does the initials of php stand for?
What is warning – “cannot modify header information – headers already sent”?