simpleWordsCloud/create.php

37 lines
840 B
PHP

<?php
include('templates/header.php');
include('db.php');
$db = new DataBase();
if (!$db->isInit()) {
echo 'Error db init';
return;
}
$db->cleanCloud();
$length = 6;
$token = bin2hex(random_bytes($length));
while (!$db->createCloud($token)) {
$token = bin2hex(random_bytes($length));
}
?>
<div id="cloud_links">
<div id="cloud_links_results" class="cloud_link">
<span class="label">Voici le lien pour visualiser le nuage de mots</span>
<span class="link">
<a href="result.php?id=<?php echo $token ?>">id=<?php echo $token ?></a>
</span>
</div>
<div id="cloud_links_vote" class="cloud_link">
<span class="label">Voici le lien pour participer au nuage</span>
<span class="link">
<a href="index.php?id=<?php echo $token ?>">id=<?php echo $token ?></a>
</span>
</div>
</div>
<?php
include('templates/footer.php');