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

What Is a Persistent Cookie?

0 Answers  


The left association operator % is used in PHP for?

0 Answers  


What is filter_var?

0 Answers  


Is php object oriented?

0 Answers  


What is .htaccessfile and use of this file

5 Answers  


how to get substring of string without using substr() function in php ????

3 Answers  


What's the difference between using mysql_ functions and pdo?

0 Answers  


how we can retrive data in pdf along php mysql?

2 Answers  


How can we check the value of a given variable is a number?

0 Answers  


How can I reverse sort an array keeping the correlation between the index and value?

2 Answers   Rushmore Consultancy,


what mode to use when creating dirs with mkdir?

1 Answers  


How to take a substring from a given string in php?

0 Answers  


Categories