ciao , volvo sapere se era possibile creare un javascript che reinderizzi l'utente in un'altra pagina dopo aver completato l'accesso al sito .
io ho creato questa funzione :
eventi.js
ovviamente il mio file dove tengo i js è esternocodice://REINDERIZZAMENTO ALLA PAGINA CON TEMPO //TEMPO IN MILLISECONDI 1000= 1 SEC function indirizza($link) { location.href = $link; window.setTimeout("",0); }
lo richiamato cosi nella pagina di login
login.php
però come faccio a mandare a eventi.js la stringa nella quale esiste il link per la pagina?codice:<head> <title>Registra</title> <script type="text/javascript" src="utility/eventi.js"></script> </head> <body>
codice:if (($password != "" ) && ($utente != "")) { require 'connessioni/db.php'; $conn = mysql_connect($server_locale, $db_user , $db_pass) or die ("connessione al db fallita -->" .mysql_error()); $query = "SELECT idutenti , utente , nome , mail , password FROM utenti ;"; $nome = mysql_select_db($db_nome); $esegui = mysql_query ($query) or die ("esecuzione quary fallita -->" .mysql_error()); $conta_righe = mysql_num_rows($esegui); while ($row = mysql_fetch_assoc($esegui)){ $id = $row['idutenti']; $ut = $row['utente']; $nm = $row['nome']; $ml = $row['mail']; $ps = $row['password']; if (($passcry == $ps) && ($utente == $ut)){ echo "pass giusta ----> utenti registrati = $conta_righe"; $start_session; $_SESSION['id'] = $id; $_SESSION['nm'] = $nm; $_SESSION['ml'] = $ml; $_SESSION['ps'] = $ps; $_SESSION[] = $id; $test = "passato" ; break; }else{ $test = "fallito"; } } if ($test == "fallito"){ echo "nessun utente trovato; riprovare o registrarsi " ; }else{ /*qui dovrei inserire i dati per l'invio automatico a eventi.js e il suo reinderizzamento*/ } mysql_close($conn); }

Rispondi quotando