0

like in the topic, I want to click a button on a page, which I do not own. There are no forms, just a button which I want to click in a time interval like 3 minutes.

Is it possible?

for example: http://www.google.com click the search button only programmatically by calling a php-script

0

2 Answers 2

2

Do you mean actually click that button in user's browser or just perform the same action as if user would click it (for example, get search results in your PHP program)?

You definitely cannot do the first as you'll need to use some javascript. And in fact even javascript might not be possible due to security restrictions (you can't access a page loaded from different domain).

As for simulating the browser in PHP - this is very possible as this is esssentially sending a HTTP request. You can either build the request yourself and send from PHP to the server using one of socket PHP extensions, curl or fopen wrappper. Or you can use one of several available PHP libraries such as Guzzle ( http://guzzle.readthedocs.org/en/latest/ ) or Symfony BrowserKit ( http://symfony.com/components/BrowserKit ) .

Sign up to request clarification or add additional context in comments.

Comments

0

No, that's not possible with PHP. You could try with JS and iFrame or with C#.

1 Comment

Learn ye turing completelness.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.