header("Location:index.php?page=filtre¶metre=toto");
header("Location: index.php?page=filtre¶metre=toto");
Mais même avec l'ajout de l'espace, cela ne fonctionne pas plus
header("Location: http://".$_SERVER['HTTP_HOST']."/index.php?page=filtre&listenoir_add=ok");
ET POURTANT
Et ce n'est pas parce que ça fonctionne chez toi, sur TON serveur, et avec TON navigateur, que ça fonctionnera ailleurs.
et pourtant mon script fonctionne ...
<form action='' method='post'> <label for="addnoir">Site à ajouter</label> </form>
if (isset ($_POST['addnoir']) && ($_POST['addnoir'] == "")) { header("location:index.php?page=filtre&listenoir_add=erreur"); } if (isset ($_POST['addnoir']) && ($_POST['addnoir'] != "")) { mysql_select_db($database_dbprotect, $dbprotect); $user = $_SESSION['login']; $quand = date("Y-m-d H:i:s"); $modif = "Ajout de l adresse ".$_POST['addnoir']." à la liste NOIRE"; $sql = "INSERT INTO historique (id_historique, user, quand, modification) VALUES ('', '$user', '$quand', '$modif')"; mysql_query($sql); $aj = $_POST['addnoir']; $maj = $aj."\n"; $nom_fichier='dans/bannedsitelist'; file_put_contents($nom_fichier, $maj, FILE_APPEND); header("location:index.php?page=filtre&listenoir_add=ok"); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<form action="recu.php" method="post"> <label for="addnoir">Site à ajouter</label> </form>
<?php if (isset ($_POST['addnoir']) && !empty($_POST['addnoir'])) { echo $_POST['addnoir'] ; 'act ecrit base'; mysql_select_db($database_dbprotect, $dbprotect); $user = mysql_real_escape_string($_SESSION['login']); $quand = date("Y-m-d H:i:s"); $modif = "Ajout de l adresse ".$_POST['addnoir']." à la liste NOIRE"; mysql_real_escape_string($modif); $sql = "INSERT INTO historique (id_historique, user, quand, modification) VALUES ('', '$user', '$quand', '$modif')"; mysql_query($sql); $aj = $_POST['addnoir']; $maj = $aj."\n"; $nom_fichier='dans/bannedsitelist'; file_put_contents($nom_fichier, $maj, FILE_APPEND); header("location:index.php?page=filtre&listenoir_add=ok"); } else { //echo "rien ne marche !"; header("location:index.php?page=filtre&listenoir_add=erreur");exit; } ?>
<?php echo $_GET['page'].' '; echo $_GET['listenoir_add'].' '; ?>
Il y a un L majuscule à Location hein
header("Location: index.php?page=filtre¶metre=toto");
Note l'espace après les ":"
le problème tu fais deux test identiques il me semble !
if (isset ($_POST['addnoir']) && ($_POST['addnoir'] == "")) if (isset ($_POST['addnoir']) && ($_POST['addnoir'] != ""))
<meta http-equiv="refresh" content="0;URL=index.php?page=filtre¶metre=toto">