First version of the WordsCloud site
This commit is contained in:
commit
8a6973fcb6
13 changed files with 1656 additions and 0 deletions
36
save.php
Normal file
36
save.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
include('db.php');
|
||||
$db = new DataBase();
|
||||
if (!$db->isInit()) {
|
||||
echo 'Error db init';
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($_POST)) {
|
||||
header('Location: index.php');
|
||||
die();
|
||||
}
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($_POST);
|
||||
echo '</pre>';
|
||||
|
||||
$id = null;
|
||||
foreach ($_POST as $name => $value) {
|
||||
if ($name == 'fid') {
|
||||
$id = $value;
|
||||
continue;
|
||||
}
|
||||
if (isset($id)) {
|
||||
$value = trim(strtolower($value));
|
||||
$db->addWord($id, $value);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($id)) {
|
||||
header('Location: index.php');
|
||||
die();
|
||||
}
|
||||
header('Location: result.php?id=' . $id);
|
||||
die();
|
Loading…
Add table
Add a link
Reference in a new issue