Ejemplo n.º 1
0
 haq.irfan89@gmail.com
*/
include "DataBase.class.php";
if (isset($_POST['table'])) {
    $table = $_POST['table'];
    $id = $_POST['id'];
    $dbname = 'mapdatabase';
    //Name of the database
    $dbuser = '******';
    //Username for the db
    $dbpass = '';
    //Password for the db
    $dbserver = 'localhost';
    //Name of the mysql server
    $db = new dataBase("{$dbuser}", "{$dbpass}", "{$dbserver}");
    $dbcnx = $db->connectDb();
    $db->selectDb($dbname);
    if ($db->delete($table, $id)) {
        echo "Data Deleted \n";
        echo "Redirecting in 5 seconds...";
        header('Refresh: 5; URL=map.php');
    } else {
        echo "Not Deleted \n";
        echo "Redirecting in 5 seconds...";
        header('Refresh: 5; URL=delete.php');
    }
} else {
    ?>
<div align="center" class="center">
<div align="center"><font size="6" >Enter Table name and ID you want to delete</font> </div><br>
<!--form for take user input-->