Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6178371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:26:43+00:00 2026-05-24T00:26:43+00:00

I am attempting to make a dead simple webpage that does things when I

  • 0

I am attempting to make a dead simple webpage that does things when I click a button.

I am trying to use Javascript so I don’t have to reload the main page or anything.

So I want a button that says “Shutdown”, and I simply want to run shutDown.php that will shut down the server when I click on this.

I’ve been searching for an hour now and can’t find a simple example. Could someone please post a very simple, example, or a link to one?

Many thanks 🙂

EDIT:
Okay so here’s my pitiful attempt.. it doesn’t work.. any tips?

<html>
<head>
<title>Control Page</title>
</head>

<body>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript">
/*************************************
JQUERY EXAMPLE
*************************************/
$('#mysubmit').click(){
    var jqueryXHR = $.ajax({
        'type': 'POST',
        'url': 'http://localhost/killIE.php',
        'dataType': 'json'
       });
    }
}
</script>

<input type="submit" name="mysubmit" value="Click!" />


</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:26:44+00:00Added an answer on May 24, 2026 at 12:26 am

    Yep – technology called called AJAX.
    You can either write it in raw javascript or use ready made libraries.
    The most popular JS library nowadays (subjectively) is jQuery, I’ll use it in my example.

    NOTE: this will trigger your shutDown.php PHP script on the server without reloading the page. But – you won’t be able to parse web requests obviously after you shutdown your server :)…

    /*************************************
    JQUERY EXAMPLE
    *************************************/
    $('#myShutdownButton').click(){
        var jqueryXHR = $.ajax({
            'type': 'GET',
            'url': 'http://someServer.com/shutDown.php',
            'data': {'shutdownServer': 'yes'},//optional
            'dataType': 'json'
           });
        }
    }
    

    P.S. I assume that you know that you have to load jQuery library first in your html file header, something like this:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
    

    And then put that jquery code inside of script tags:

    <script>
    ...that jQuery code...
    </script>
    

    UPDATED BY REQUEST – complete script version

    <html>
    <head>
    <title>Control Page</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
        <script>
            //we need document.ready call to make sure that DOM loaded before we try to bind anything
            $(document).ready(function() {
                //Here we bind click event
                $('#mysubmit').bind('click', function(e){e.preventDefault();
                    //This is what happens on click - we send AJAX request
                    var jqueryXHR = $.ajax({
                        'type': 'POST',
                        'url': 'http://localhost/killIE.php',
                        'dataType': 'json'
                       });
                    //And when AJAX requests complete(succeeded or failed) - we update text
                    jqueryXHR.complete(function(){  
                        $('span#result').html('Oh no!!! the End is neearh! erver is shutting DoWn.')
                    });
                })
            });
        </script>
    </head>
    <body>
        <input type="submit" id="mysubmit" value="Kill da server!" style = "margin-left:100px; margin-top:100px;" />
        <br/>
        <br/>
        <br/>
        <span id = "result">Not clicked yet - good!</span>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am attempting to make a really simple lightbox that I can use
I am attempting to make a simple class that serializes itself to disk when
I am attempting make a simulator class that will use a Queue to add
I am attempting to make a simple column system I can use on a
I'm attempting to make a simple homebrew game engine/framework in android. I have the
Attempting to make a NSObject called 'Person' that will hold the login details for
I'm attempting to make a very simple 2-person chatroom for my Django site. I'm
I'm attempting to make use of the UIDocumentInteractionController mechanism in iPhone OS 3.2, but
I make use of generic views and I am attempting to query my MySQL
Im attempting to make a little app that lets you add text boxes to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.