Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

problème php avec cookies ;)

Featured Replies

Posté(e)

Rebonjour à tous, encore moi et me probleme php :francais:

alors voici mon erreur

Warning: Cannot modify header information - headers already sent by (output started at /home/.filer2/quickandfree/www/Handball/admin/indent.php:3) in /home/.filer2/quickandfree/www/Handball/admin/indent.php on line 9

et voici la ligne en question

if($pass='monpass')

{

setcookie("identificationaln","monpass",time()+60,"");

echo"Vous êtes identifié, <a href=index.php>Accéder à l'administration</a>";

}

quel probleme y a t-il ici ?

merci beaucoup d'avance de vos réponses :transpi:

Posté(e)
Les cookies doivent passer avant tout autre en-tête (c'est une restriction des cookies, pas de PHP). Cela vous impose d'appeler cette fonction avant toute balise <html>  ou <head>  . Si quelque chose a été envoyé avant l'appel à cette fonction, setcookie  échouera et retournera FALSE  .

Dixit l'excellente doc : www.nexen.net

Ca résoud ton pb ?

Modifié par fabien29200

Posté(e)
  • Auteur

ben du coup je met ça en haut de ma page

if($pass='abcdef1')

{

setcookie("identificationaln","pass",time()+60,"");

echo"Vous êtes identifié, <a href=index.php>Accéder à l'administration</a>";

}

else

{

echo"

<br>Entrer le mot de pase

<form action=indent.php?pass=$password method=post>

<input type=password name=password size=40 maxlength=256>

<input type=submit value=Identification>

</form>

";

}

et ça me met pas d'erreur ça me dit identification réussi alors que la variable password n'existe pas :(

Posté(e)

Déjà, dans un if, l'opérateur de comparaison est == et non pas =

donc il ne fait aucune vérification.

Modifié par fabien29200

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.