Beispiel #1
0
<?php

include 'kanji.php';
//mb_internal_encoding('UTF-8');
$required = array('kanji', 'pronunciation', 'english_translation');
if (!empty($_POST)) {
    $missing = false;
    foreach ($_POST as $key => $value) {
        if (empty($value) && $key != 'link') {
            $missing = true;
        }
    }
    if (!$missing) {
        $kanji = new Kanji($_POST);
        $kanji->insert();
        header('Location: manage.php');
    }
}
show_form($required);
function show_form($required)
{
    ?>
<!doctype html>
<html>
<head>
<title>Add Kanji</title>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
  <h1>Add Kanji</h1>