1

Apologies if I am asking a dummy question but honestly I had searched this a lot but not getting much information so thought to post it here. So I have a UI(running on apache, in html) where have a button, now from that button I want to call a shell script and stop a certain service, could you please guide me how to do it?

I do searched and got to know about node.js but as a DUMMY in server side programming I am not able to do this, will be grateful to you if experts could guide me here.

0

1 Answer 1

4
 if (validate()) { // Preliminary data check to preven unecessary request
  $.ajax(
  '/path/to/your-script', { // the URL where the php script is hosted
     'action': 'update', // variables passed to the server
     'id': '123',
     'value': 'New Value'
  }, function (response) { // server response
   if (typeof(response.success) == 'number' && response.success) {
     }
  }, 'json' // data format
 );
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Sameera for guidance, actually you are right we should use ajex from client(browser) side for this and server side whatever thing we are using should handle it. I have done it by ajex and from server side have used Django and created it successfully, thank you all for your support and help here. LOVE You Stackoverflow

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.