Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

press javascript button remotely?

Status
Not open for further replies.

tipper1

Programmer
Apr 20, 2017
3
US
My modem/router has a web interface where you can press a button to connect to ISP if connection drops. This is a manual process. The web interface has a huge amount of javascript and I am not a javascript expert. The HTML for the reconnect button looks like:

<a href="javascript:do_apply(1);" id="connect_btn" class="btn" width="70%">

I need to "press" this button from a PHP program on my home network using cURL. Is there a way to form the URL so this button is "pressed"? Thanks.
 
Add the necessary parameters to the URI as a querystring (always assuming the ISP process accepts GET queries)

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Any suggestions on what parameters in a URL query string result in execution of a javascript function?

192.168.254.254/index.htm?function=do_apply(1)

?
 
Haven't a clue, without seeing all of the code from your router's firmware HTTP server ... ... only your ISP can tell you that.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
well... i can view the page source with firefox but might be harder if script calls in stuff from elsewhere... probably just end up using telnet from PHP script to test connection and reconnect if necessary... fun job for weekend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top