示例#1
1
<?php

require "class/Persistence.php";
//Populate database on first run
$pers = new Persistence();
$pers->populateDatabase();
if (isset($_POST["fName"]) && isset($_POST["lName"])) {
    if (!empty($_POST["fName"]) && !empty($_POST["lName"])) {
        $pers->save($_POST["fName"], $_POST["lName"]);
    }
}
if (isset($_POST["btnRemove"])) {
    $pers->delete($_POST["btnRemove"]);
}
?>
<!DOCTYPE html>
<!--
*File: index.php
*
*Copyright (c) 2015 Marcos Macedo <*****@*****.**>
*Developed for client at Upwork.com
*For usage permissions of this file please contact at marcos@softdev.science or the corresponding copyright holder.  
-->

<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="css/bootstrap.min.css" 
        <script src="js/bootstrap.min.js" type="text/javascript"></script>      
        <title>Name Directory</title>