I was trying to make an html button load some sql script, and the way I figured best to do it was with an html form using post method and loading another php page which contains the script. The problem is it then just shows a blank page once it completes but I would rather reload the previous page.
Originally I wanted to just load the script on the same page and refresh it but found this to be easier.
Here is what I have so far:
<form action="move_to_processing.php" method="post" onsubmit="return confirm('Are you sure you want to move them??');">
<input type='submit' name='hehe' value="Move to processing" />
</form>
and then the page move_to_processing.php loads which is just a page with the sql. This is working right now.
I tried doing the following to just reload the current page (orders.php) but it didn't seem to work:
<form action="orders.php" method="post" onsubmit="return confirm('Are you sure you want to move them??');">
<input type='submit' name='hehe' value="Move to processing" />
</form>
<?php
if(isset($_POST['hehe'])){
tep_db_query("update orders o set o.orders_status= 13 where o.orders_status = 12");
}
}