pagina vuota. Perchè????
-
Ture_70
ma...il login mi funziona...mi entra tranquillamente nella pagina materie.php (che è protetta)...nella pagina materie.php sono linkate diverse pagine 8sempre del mio sito, ma in cartelle diverse) e praticamente vorrei sapere come fare per proteggere queste pagine....
prova a mettere nelle tue pagine che vuoi proteggere
if(!isset($_SESSION['username'])) { $messaggio=urlencode("Ti consiglio di autenticarti"); header('location:'.lo percorso.php'.'?msg='.$messaggio); exit; }mettendo sempre prima i file di connessione
fammi sapere
ciao
-
-
-
-
è un pezzo di codice php giusto??? quindi nelle pagine metto questo:
require ('config-clas.php');il file config-clas.php si trova in una cartella, quindi dovrei mettere:
require ('indirizzo_del_file/config-clas.php');???????????????????????????????????
-
-
-
-
-
-
Ture_70
praticamente da errore qui:
header('location:'.lo percorso.php'.'?msg='.$messaggio);al posto di "lo percorso" ho provato a inserire sia index.php sia orale_chimica.php ma da sempre lo stesso errore
dovresti mettere il persorso giusto dove vuoi mandarlo
ti scrivo la sintassi giusta
header('location:'.'watch/accept.php'.'?msg='.$messaggio); -
si...quello l' ho risolto...ora però mi da pagina completamente bianca.... e se provo a controllare l' html della pagina c'è scritto solo:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD> <BODY></BODY></HTML>mentre la pagina che ho pubblicato io era piena di codice....
-
-
certo....te ne invio una...
orale_chimica.php<?php require ('ture70.netsons.org/config-clas.php'); if(!isset($_SESSION['username'])) { $messaggio=urlencode("Ti consiglio di autenticarti"); header('location:'.'ture70.netsons.org/index.php'.'?msg='.$messaggio); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>orali_chimica</title> </head> <body bgcolor="black"> <center> <img src=""> <img src=""> <img src=""> </center> <br> <center> <font color="yellow" size="24"> SETTEMBRE </font> </center> <center> <table border="1" width="650" height="350"> <td width="15%"> <center> <font color="blue"> GIORNO </font> </center> </td> <td width="15%"> <center> <font color="blue"> INTERROGATI </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 15 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 16 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 17 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 18 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 19 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 20 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 22 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 23 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 24 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 25 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 26 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 27 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 29 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> <tr> <td width="15%"> <center> <font color="yellow"> 30 </font> </center> </td> <td width="85%"> <center> <font color="yellow"> #### - #### </font> </center> </td> </table> </center> </body> </html>La babella non è una sola (come vedi qui, ma in tutto sono 10) compresa questa.
PS: Ho dovuto levare i link perchè nn sn un utente premium
-
E' normale che se scrivi direttamente l'url acceddi, perchè sei comunque loggato, se fai il logout distruggi la sessione e quindi il controllo vede la variabile di sessione come non settata effettuando il redirect.
-
-
se non fai il logout, e quindi la sessione non viene distrutta rimani loggato e hai accesso alla pagina, quindi dovresti creare una pagina di logout.
Puoi provare tu stesso eliminando i cookie del browser, cosi da sloggarti... -
:x...ho cancellato tutto....cookie, file temporanei, cronologia...tutto!! eppure mi ci fa entrare...se nn mi credi, controlla tu stesso:
ture70.netsons.org/materie.php (tu nn sei registrato nel mio database)
PS: prima ci hakkattp2punti//vuvuvu (non possoscrivere i link perchè nn sn utente premium)
grazie per l' interesse. -
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /www/netsons.org/ture70/web/index.php on line 20
-
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi