simpleWordsCloud/index.php

44 lines
844 B
PHP
Raw Normal View History

2020-11-15 21:51:28 +01:00
<?php
include('templates/header.php');
include('db.php');
$db = new DataBase();
if (!$db->isInit()) {
echo 'Error db init';
return;
}
$db->buildTables();
if (isset($_GET['id'])) {
$id = $_GET['id'];
if (!$db->isCloud($id)) {
echo 'NO CLOUD';
return;
}
$nbWords = 3;
?>
<form method="post" action="save.php">
<input type="hidden" id="fid" name="fid" value="<?php echo $id;?>">
<?php
for ($i=0;$i<$nbWords;$i++) {
$name = 'fword' . $i;
?>
<label for="<?php echo $name;?>">test</label>
<input type="text" id="<?php echo $name;?>" name="<?php echo $name;?>">
<?php
}
?>
<input type="submit" value="Submit">
</form>
<?php
} else {
?>
<p>Voulez-vous créer un nouveau nuage de mots?</p>
<form method="post" action="create.php">
<input type="submit" value="Créer">
</form>
<?php
}
include('templates/footer.php');
?>