Reputation: 1205
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
Upvotes: 0
Views: 241
Reputation: 1767
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 ) .
Upvotes: 2
Reputation: 375
No, that's not possible with PHP. You could try with JS and iFrame or with C#.
Upvotes: 0