Insert text in input text in another web with php?


How can I insert text in input text from another web with php? How can I press a button on another website with php?

asked by Hamwen 28.12.2016 в 13:12

1 answer


1: If you are the owner of the web and we are in a form for example, you can call the POST method by adding the corresponding variables, in this case using the answer 2. Alternatively you can use GET simply by calling the url from the answer 2 .

If your form to be sent is

Simply call that url from Curl.

2: You can use Curl for PHP, it allows you to consume data from urls and then process them on your server.

$ch = curl_init("");
$fp = fopen("example_homepage.txt", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);


In that simple example, the response of the site is saved in a .txt file, you can also click on a button as you say, just call curl_init next to the url of the action that generates / performs the button.


answered by 28.12.2016 в 14:32