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 difference Between PHP 5 and 7?

0 Answers  


How can we enable error reporting in php?

0 Answers  


•How can we submit a form without a submit button

5 Answers  


How do you use bcrypt for hashing passwords in php?

0 Answers  


Write an example to remove html tags from a string in php?

0 Answers  






Do you know how to delete a file from the system?

0 Answers  


what is mean php ? is it designingtool or language? how ill create website using by php?

1 Answers  


What is uri routing?

0 Answers  


Is php harder than javascript?

0 Answers  


how we can upload and view video files

2 Answers  


Which is better #define or enum?

0 Answers  


What is difference between mysql_connect and mysqli_connect?

0 Answers  


Categories