basic-php-12-admin-delete-user.php / php
<?php session_start(); include "auth_admin.inc.php"; include "conn.inc.php"; if (_POST['submit']) && query_delete = "DELETE FROM user_info " . "WHERE id = '" . result_delete = mysql_query(_SESSION['user_logged'] = ""; <br>"; echo "(If you're browser doesn't support this, " . "<a href=\"admin_area.php\">click here</a>)"; die(); } else { ?> <html> <head> <title>Beginning PHP5, Apache and MySQL</title> </head> <body> <h1>Admin Area</h1> <p> Are you sure you want to delete this user's account?<br> There is no way to retrieve your account once you confirm!<br> <form action="delete_user.php" method="post"> <input type="hidden" name="id" value="<?php echo _GET['id']; ?>"> <input type="submit" name="submit" value="Yes"> <input type="button" value=" No " onclick="history.go(-1);"> </form> </p> </body> </html> <?php } } else { ?> You don't have a high enough privilege to delete a user.<br> <a href="admin_area.php">Click here</a> to go back. <?php } ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.