File "page2.php"
Full Path: /home/analogde/www/FTP/Monsta-FTP-master/page2.php
File size: 1.26 KB
MIME-type: text/x-php
Charset: utf-8
<?php
// Récupérer l'URL de la page précédente (passée en paramètre)
$source = isset($_GET['source']) ? $_GET['source'] : 'titi.html';
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>P2</title>
<script>
// Désactiver la touche retour en arrière du navigateur
/*window.history.pushState(null, "", window.location.href);
window.onpopstate = function () {
window.history.pushState(null, "", window.location.href);
};*/
/*history.forward();
function disableBack() { window.history.forward(); }
setTimeout("disableBack()", 0);
window.onunload = function () { null };*/
function DisableBackButton(){
window.history.forward()
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function(evt) { if (evt.persisted) DisableBackButton() }
window.onload = function() {void(0)}
// Fonction pour revenir à la page source
function goBack() {
window.location.href = "<?php echo htmlspecialchars($source); ?>";
}
</script>
</head>
<body>
<h1>Bienvenue sur P2</h1>
<button onclick="goBack()">Revenir à la page précédente</button>
</body>
</html>