|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Dec 2011
Messaggi: 38
|
[PHP] problemino header()
salve raga, sapreste dirmi perche in localhost dopo il login non mi reinderizza alla pagina riservata.php? dal manuae dovrebbe farlo
session_start (); $nome_utente = "222"; $password = "333"; if ((!isset($_POST['utente'])) && (!isset($_POST['password']))) { echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\"> User: <input type=\"text\" name=\"utente\"><br> Password: <input type=\"password\" name=\"password\"><br> <input type=\"submit\" value=\"Invia\"></form>"; } else { if (($_POST['utente']==$nome_utente)&&($_POST['password']==$password)) { $_SESSION['utente']=$_POST['utente']; $_SESSION['password']=$_POST['password']; header("Location: utenti/riservata.php");----qui ho provato anche a tenerla nella root della pagina principale togliendo "/utenti" } else {echo "Login errato";} } nealla pagina riservata ho messo session_start(); if(isset($_SESSION['utente'])&& isset($_SESSION['utente'])) { echo "Ciao " . $_SESSION['utente']; }else{ echo "Accesso non consentito"; ?> Ultima modifica di trinakrius : 27-01-2012 alle 16:17. Motivo: integrazione |
![]() |
![]() |
![]() |
#2 |
Member
Iscritto dal: Dec 2011
Messaggi: 38
|
potete chiudere dato che ho trovato un'altra via....posterò un nuovo thread
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:43.