Some trivial administrator interface
For our application, you can create an administrator interface as a single php script, which will allow tables to be cleaned by an administrator. It could be done by simple form, which only allows to execute an SQL command. We don't need even to create a password protected access for this page, simply assume, that administrator should know the database password. Without inserting this, script will not work.
To make only one script, the script should call itself. As a first, it should execute an SQL command, if there is any, then it can offer an input box to write next one. We use the POST method - on the beginning of php, we should check, if there has been sent the correct data in the $_POST array. If not, or if password is wrong, don't show the mysql_query response, and ask for data refill:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <title>Administrator table listing</title> </head> <body> <?php if ($_POST['submit']=="Execute") // or: |
Change the green texts to your values.
Program should be saved with the name admin.php, or this script name should be changed - it is written in the red as an action parameter of the form. Tested version.