Link to home
Start Free TrialLog in
Avatar of EMB01
EMB01Flag for United States of America

asked on

Run JavaScript Function Remotely with PHP

If I have a PHP script that loads the content of an external HTML page, for instance:
fopen("http://www.example.com", "r");

Is it possible to execute JavaScript commands that exist on that page? For example, if a button exists on that page like:
<a href="" onclick="javascript...">Link</a>

Could I run that JavaScript from my PHP script?
Avatar of striker46
striker46
Flag of Germany image

PHP is server side, JS is client side. You cannot run JS directly in PHP.
ASKER CERTIFIED SOLUTION
Avatar of palanee83
palanee83
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial