I have the following form:
HTML
<form id="myForm" action="" method="post">
<div id="edit-box">
<INPUT type="submit" name="save-text" id="save-text" value="Save">
<textarea id="editor" name="editor">
<?php echo $content; ?>
</textarea>
</div>
</form>
PHP
if ($_POST["save-text"]){
// get form data and do stuff here
}
How can I make sure that the PHP script is run only when the submit button is clicked and no other time?