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

How to read a file in binary mode?

0 Answers  


How does php serialize work?

0 Answers  


what are the differences between php and perl

0 Answers   TCS,


Why is node js better than php?

0 Answers  


How to create a table to store files?

0 Answers  






What do you use php for?

0 Answers  


What is php limit?

0 Answers  


i want to store retrieved data from database into an array list with limit.And display the data from that array list.have any answer for this?

2 Answers  


What is the function used to change the root directory in PHP?

0 Answers  


what is magic code ?

4 Answers   eVenturers, iFlash, Zynga,


What does $globals means?

0 Answers  


How to break a file path name into parts?

0 Answers  


Categories