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

Answers were Sorted based on User's Feedback



Without using forms and hidden variables, how to send variables from a PHP script to another URL u..

Answer / 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

Without using forms and hidden variables, how to send variables from a PHP script to another URL u..

Answer / suren

You can get the information from the following links.

http://www.php.net/manual/en/ref.mcrypt.php


http://www.phpuk.org/code.php

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More PHP Interview Questions

Explain what is the difference between $var and $$var?

0 Answers  


Explain what are psrs? Choose 1 and briefly describe it?

0 Answers  


How can we submit a form without a submit button?

4 Answers   Agile Software,


What is the timeout period on session values?

0 Answers  


What is difference between Method overriding and overloading in PHP?

0 Answers  






Can we use include ("xyz.php") two times in a php page "index.php"?

0 Answers  


How to upload and play video in Php when u r in localhost?

3 Answers   HCL,


Explain the difference b/w static and dynamic websites?

0 Answers  


How does header() work . What do they tell the server same question for SESSIONS

2 Answers   Yahoo,


Is php an array?

0 Answers  


What is difference between variable declaration and variable definition?

0 Answers  


Why do we use inheritance in php?

0 Answers  


Categories