ho provato a usare le sessioni cosi
e funziona fin li dato che mi crea le sessioni sul server e poi ho trovato questocodice:if($status == AUTH_LOGGED & auth_get_option("TRANSICTION METHOD") == AUTH_USE_SESSION ){ $link = "?uid=".$_GET['uid']; }else $link = '';
ho poi provato a sostituire questo tempo:codice:<?php $_CONFIG['host'] = "localhost"; $_CONFIG['user'] = "stronzatebook"; $_CONFIG['pass'] = "rftglc920613"; $_CONFIG['dbname'] = "my_stronzatebook"; $_CONFIG['table_sessioni'] = "sessioni"; $_CONFIG['table_utenti'] = "utenti"; $_CONFIG['expire'] = 60;// questo dovrebbe il tempo della sessione giusto? $_CONFIG['regexpire'] = 24; //in ore $_CONFIG['check_table'] = array( "username" => "check_username", "password" => "check_global", "name" => "check_global", "surname" => "check_global", "indirizzo" => "check_global", "occupazione" => "check_global", "mail" => "check_global" ); function check_username($value){ global $_CONFIG; $value = trim($value); if($value == "") return "Il campo non può essere lasciato vuoto"; $query = mysql_query(" SELECT id FROM ".$_CONFIG['table_utenti']." WHERE username='".$value."'"); if(mysql_num_rows($query) != 0) return "Nome utente già utilizzato"; return true; } function check_global($value){ global $_CONFIG; $value = trim($value); if($value == "") return "Il campo non può essere lasciato vuoto"; return true; } //-------------- define('AUTH_LOGGED', 99); define('AUTH_NOT_LOGGED', 100); define('AUTH_USE_COOKIE', 101); define('AUTH_USE_LINK', 103); define('AUTH_INVALID_PARAMS', 104); define('AUTH_LOGEDD_IN', 105); define('AUTH_FAILED', 106); define('REG_ERRORS', 107); define('REG_SUCCESS', 108); define('REG_FAILED', 109); $conn = mysql_connect($_CONFIG['host'], $_CONFIG['user'], $_CONFIG['pass']) or die('Impossibile stabilire una connessione'); mysql_select_db($_CONFIG['dbname']); ?>
$_CONFIG['expire'] = 60;
con
$_CONFIG['expire'] = 10000;
e rimane collegato di più...
Però avendo sostituito la dicitura
inserendo le sessioni creerei dei problemi con i cookie???codice:if($status == AUTH_LOGGED & auth_get_option("TRANSICTION METHOD") == AUTH_USE_SESSION ){ $link = "?uid=".$_GET['uid']; }else $link = '';
e comunque se usassi il passagio dati con i link dovrei tenerli con questo modo?? cioe tenedo la inclusione <?=$link?> ??
<td>Prima Pagina (pubblica)</td>
comunque sto lavorando con dei template prelevati dalla gestione utenti con il PHP..
Ah gia mi dimenticavo :master: :master:
Posso inserire in questa index
un chebox ricordami o resta collegato anke quando si chiude il browser o finisce la sessione??codice:<?php include_once("include/config.php"); include_once("include/auth.lib.php"); include_once("include/cookie.php"); list($status, $user) = auth_get_status(); if($status == AUTH_LOGGED & auth_get_option("TRANSICTION METHOD") == AUTH_USE_SESSION){ $link = "?uid=".$_GET['uid']; }else $link = ''; ?> <html> <head> <title>Stronzatebook</title> <link href="/stili.css" rel="stylesheet" type="text/css"> </head> <? if(isset($_POST['ricordami'])) { $joined =''.$_POST['username'].'[]'.md5($_POST['password']).''; setcookie($nome_cookie, $joined, time()+$scadenza, $percorso, $dominio); } ?> <body> <table height="446" border="0" align="center"> <tr> <td width="118" rowspan="3"></td> <td width="752" align="center">[img]/immagini/server-d-prova.jpg[/img]</td> <td width="91" rowspan="3"></td> </tr> <tr> <td align="center"><table border="0"> <tr> <td> <?php include('frame/menu.html');?> </td> </tr> </table></td> </tr> <tr> <td></td> </tr> <tr> <td height="207"></td> <td><div align="center"> <?php switch($status){ case AUTH_LOGGED: ?> Sei loggato con il nome di <?=$user["name"];?> Logout <?php break; case AUTH_NOT_LOGGED: ?> </p> <form action="login.php<?=$link?>" method="post"> <table cellspacing="2"> <tr> <td class="loggin">Nome Utente:</td> <td><input type="text" name="uname"></td> </tr> <tr> <td class="loggin">Password:</td> <td><input type="password" name="passw"></td> </tr> <tr> <td class="loggin">Ricordami</td> <td><input type="checkbox" name="ricordami[]" value="ON" class="check"></td> </tr> <tr> <td colspan="2"><input name="action" type="submit" class="loggin" value="Login"></td> </tr> </table> </form> <?php break; } ?> </div></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> </p> </body> </html>
Grazie di nuovo in anticipo![]()
![]()
![]()
![]()

Rispondi quotando