mixalis8 Δημοσ. 19 Ιουλίου 2006 Δημοσ. 19 Ιουλίου 2006 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Untitled Document</title> </head> <body> <? /* Check User Script */ session_start(); // Start Session include 'db.php'; // Conver to simple variables $username = $_POST['username']; $password = $_POST['password']; if((!$username) || (!$password)){ echo "Please enter ALL of the information! <br />"; include 'login.html'; exit(); } // Convert password to md5 hash $password = md5($password); // check if the user info validates the db $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); if($login_check > 0){ while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // Register some session variables! session_register('first_name'); $_SESSION['first_name'] = $first_name; session_register('last_name'); $_SESSION['last_name'] = $last_name; session_register('email_address'); $_SESSION['email_address'] = $email_address; session_register('special_user'); $_SESSION['user_level'] = $user_level; mysql_query("UPDATE users SET last_login=now() WHERE userid='$userid'"); header('Location: login_success.php'); } } else { echo "You could not be logged in! Either the username and password do not match or you have not validated your membership!<br /> Please try again!<br />"; include 'login.html'; } ?> </body> </html> logika me tin entoli header('Location: login_success.php'); den tha eprepe na me paei stin selida login_success aftomata? den me paei omos... parameno stin selida pou exi afton ton kodika... exo kanena problima ston kodika?
Hatman Δημοσ. 19 Ιουλίου 2006 Δημοσ. 19 Ιουλίου 2006 opws kai na exei an den sou trexei kane to me javascript: anti gia header... echo ' <script language="text/javascript"> document.location.href="login_success.php"; </script> ';
mixalis8 Δημοσ. 19 Ιουλίου 2006 Μέλος Δημοσ. 19 Ιουλίου 2006 opws kai na exei an den sou trexei kane to me javascript:anti gia header... echo ' <script language="text/javascript"> document.location.href="login_success.php"; </script> '; basika to echo ' kai to '; giati ta ebales? den leitourgi pali... anti gia header me ton kodika pou mou protines den egine tipota
Hatman Δημοσ. 19 Ιουλίου 2006 Δημοσ. 19 Ιουλίου 2006 to echo einai gia na mpei sthn thesh tou header... gia na petaei h php ton kwdika sthn selida ama kai otan ginei validate to password kai to username esy tha valeis ayto: echo '<script language="javascript"> location.href="login_success.php"; </script> '; Sorry egw eixa kanei lathos sthn javascript.
mixalis8 Δημοσ. 19 Ιουλίου 2006 Μέλος Δημοσ. 19 Ιουλίου 2006 file... xilia euxaristo.... lithike.... (ekana omos kai anabathmisi to M.A.M.P. giati ipirxan kapoia bugs... tora lithike...) kernao kafe....
Hatman Δημοσ. 20 Ιουλίου 2006 Δημοσ. 20 Ιουλίου 2006 xaxax na eisai kala. kanonika wmws prepei na trexei ayto pou exeis valei se php. koita3e to. se windows trexeis ton server?
mixalis8 Δημοσ. 20 Ιουλίου 2006 Μέλος Δημοσ. 20 Ιουλίου 2006 xaxax na eisai kala.kanonika wmws prepei na trexei ayto pou exeis valei se php. koita3e to. se windows trexeis ton server? oxi se mac.... ase pikri istoria... se windows den katafera pote na trekso ton server... sto macbook... mesa se 5 lepta etoimo..... 1 mina pedebomoun me ta windows..... eixa bali to W.A.M.P. kai den leitourgouse.... tora ebala sto Macbook to M.A.M.P. kai leitourgi apsoga..
Hatman Δημοσ. 20 Ιουλίου 2006 Δημοσ. 20 Ιουλίου 2006 allo koulo kai ayto. nai einai paketo h prwth fora pou tha sthseis tetoia istoria se windows an den sou di3ei kapoios. eidika h php. tha prepei na sou petaei kapoio warning o apache server otan pas na steileis headers.dokimase se allh leykh selida na kaneis redirect me header kai des ti paizei. an exei warning sou leipei component mallon. an oxi kati graeis lathos.
Προτεινόμενες αναρτήσεις
Αρχειοθετημένο
Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.