forked from miraty/web
119 lines
3.3 KiB
PHP
Executable file
119 lines
3.3 KiB
PHP
Executable file
<?php include "inc/debut.php";
|
|
head("confirmationlien.php"); ?>
|
|
|
|
<?php
|
|
|
|
// ------------------------- Demander une confirmation pour aller à l'adresse du lien cliqué -------------------------
|
|
if (isset($_GET['lien'])) {
|
|
|
|
|
|
if (preg_match("#^https://|http://#", $_GET['lien'])) {
|
|
|
|
|
|
// Enregistrer le choix de ne plus confirmer de suivre les liens
|
|
if (isset($_GET['neplusconfirmer']) AND $_GET['neplusconfirmer'] == "oui") {
|
|
|
|
include "inc/loginsbdd.php";
|
|
|
|
try {
|
|
$bdd = new PDO('mysql:host=localhost;dbname=anternet;charset=utf8', $userBDD, $mdpBDD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
|
}
|
|
|
|
catch (Exception $e) {
|
|
die('Erreur PHP / MySQL : ' . $e->getMessage()); }
|
|
|
|
$req = $bdd->prepare('UPDATE `compte` SET `confirmerLien` = "non" WHERE `compte`.`pseudo` = :pseudo');
|
|
|
|
$req->execute(array(
|
|
'pseudo' => $_SESSION['pseudo']
|
|
));
|
|
|
|
$req->closeCursor();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Identifier le nom de domaine
|
|
$nomDeDomaine = htmlspecialchars(preg_replace("#https://#", "", $_GET['lien']));
|
|
$nomDeDomaine = preg_replace("#http://#", "<span class='gras'>", $nomDeDomaine);
|
|
$nomDeDomaine = preg_replace("#/s#", "SAKLDGHK", $nomDeDomaine);
|
|
$nomDeDomaine = preg_replace("#/a|/z|/e|/r|/t|/y|/u|/i|/o|/p|/q|/d|/f|/g|/h|/j|/k|/l|/m|/v|/w|/x|/c|/v|/b|/n#", "</span>", $nomDeDomaine);
|
|
$nomDeDomaine = preg_replace("#</span>.{1,100}#", "", $nomDeDomaine);
|
|
$nomDeDomaine = preg_replace("#SAKLDGHK.{1,100}#", "", $nomDeDomaine);
|
|
|
|
|
|
if (isset($_GET['nepasconfirmer']) AND $_GET['nepasconfirmer'] == "oui") { ?>
|
|
|
|
<script type="text/javascript">
|
|
setTimeout("document.location.href='<?php echo htmlspecialchars($_GET['lien']); ?>'", 0);
|
|
</script>
|
|
|
|
<?php }
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="centre t13">
|
|
<br><br>
|
|
Vous avez cliqué sur ce lien :
|
|
<br><br>
|
|
<strong class="moyen"><?php echo htmlspecialchars($_GET['lien']); ?></strong>
|
|
<br><br>
|
|
Avez-vous confiance envers ce lien ou la personne qui vous l'a envoyé ?
|
|
<br><br>
|
|
<span class="ubuntu">Souhaitez-vous suivre ce lien ?</span>
|
|
<br><br>
|
|
<a href="fourmiliere.php" class="button big icon-chevron-left">Non, revenir en arrière</a> <a href="<?php echo htmlspecialchars($_GET['lien']); ?>" class="button big special icon-check">Oui, suivre ce lien</a>
|
|
<?php if (isset($_SESSION['pseudo'])) { ?>
|
|
<br>
|
|
<br>
|
|
<a href="confirmationlien.php?neplusconfirmer=oui&lien=<?php echo htmlspecialchars($_GET['lien']); ?>" title="Ne jamais reposer cette question, toujours suivre les liens" class="button small special icon-check">toujours suivre les liens</a>
|
|
<?php } ?>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php } else { ?>
|
|
|
|
<div class="centre t13">
|
|
<br><br>
|
|
Vous avez cliqué sur ce lien :
|
|
<br><br>
|
|
<strong class="moyen"><?php echo htmlspecialchars($_GET['lien']); ?></strong>
|
|
<br><br>
|
|
Mais ce lien parait erroné : il ne parais pas utiliser le protocol <em>http</em> ou <em>https</em>.
|
|
<br><br>
|
|
<a href="fourmiliere.php" class="button big special icon-chevron-left">revenir en arrière</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { ?>
|
|
Erreur : il n'y a pas de lien en argument dans l'URL. Pour utiliser cette page, il faut ajouter à sa suite "?lien=" et une URL.
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
<?php include "inc/footer.php"; ?>
|