Jump to content

Recommended Posts

I'm trying to have a form on MY webserver, connect to a form processing script on a REMOTE webserver (which is running on a piece of audio equipment...to control the audio equipment).

 

The REMOTE script was written in AJAX.  I've never even looked into AJAX, so I'm going in blind here.

 

Here's what the manufacturer of the equipment sent me...but they won't help me anymore.

 

In order to control the Relay Sentinel from another web page, the host

system must be authenticated.  This is done by posting the username and

password credentials to "<RelaySentinelIPAddress>/cgi-bin/postauth.cgi".

You must post 'LoginUser' and 'LoginPass' to the postauth.cgi file.  If

successful a 200 OK reply will be returned along with a cookie.  This cookie

must be sent along with any additional POST or GET requests for future

authentication.  If for any reason the login was unsuccessful a 404 will be

sent back.

 

After successfully logging in you can then proceed to POST data to

"<RelaySentinelIPAddress>/cgi-bin/postexchanger.cgi".  The following are the

values to POST, you can send multiple items at once.

 

RelayStateX - where x is the relay number with a 0 index.  Values include

0-OFF, 1-ON

PulseDurX - where x is the relay number with a 0 index.  Value is in

milliseconds.  By POSTing PulseDurX the relay will pulse immediately.

RebootDurX - where x is the relay number with a 0 index.  Value is in

minutes.  By POSTing RebootDurX the relay will reboot immediatly.

 

For all POSTS a 404 indicates an invalid authentication and a 200 indicates

that the process has successfully started.

 

Can anyone shed some light on where I need to go next?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/247209-new-to-ajaxneed-some-help/
Share on other sites

Are you sure this is using AJAX?  It looks like it's using cgi scripts.  In which case you would just do a GET to the path of the postauth.cgi script on the remote server to authenticate.  Then do GETS to the path of the postexchanger.cgi processing script to communicate with the audio equipment?  Or, I'm not understanding your question.  In which case I apologize.

POST/GET it's the same thing just a different method.  I'm guessing you are going to need to build some kind of web interface with form fields to send the authentication and exchange values.

 

<form action="path/to/postauth.cgi" method="post">
User:<input type="text" name="LoginUser" />
Password:<input type="text" name="LoginPass" />
<input name="Submit" type="submit" value="Submit" />
</form>

 

Then on the postauth.cgi page you will get a 200 OK or 404 error messege and a cookie will be dropped.

 

The postexchanger.cgi script would work the same way.  Replace/add input names in another form.

 

Hope this helps?

That code ends up sending me to the login page on the REMOTE webserver (on the audio hardware).

 

I've run Firebug (debugging software from Firefox) and this is what the code is on the REMOTE webserver

 

http://209.191.211.194/brian/login.php  The code is too long to post here.

 

I tried using this code and replacing the path to the REMOTE script in the form action...and clicking on SUBMIT did NOTHING!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.