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

PHP can be used frontend of for backend?

3 Answers   Global Logic,


Which function is used in php to delete a file?

1 Answers  


How long will it take to learn php?

1 Answers  


What is an operator in php?

1 Answers  


Is runtime polymorphism overriding?

1 Answers  


Why should I store logs in a database rather than a file?

1 Answers  


What are the difference between echo and print?

1 Answers  


In How many ways can u represent Not equal?Give Syntax of all ways..

3 Answers  


Do you know what does $globals means?

1 Answers  


Explain me what is the importance of "method" attribute in a html form?

1 Answers  


Tell me how to find current date and time?

1 Answers  


How many columns can be added in a table in mysql?

1 Answers  


Categories