Προς το περιεχόμενο

Βοήθεια με header()!!!!!!!!!!!!!


mixalis8

Προτεινόμενες αναρτήσεις

Δημοσ.

<!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?

Δημοσ.

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>

';

Δημοσ.
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

Δημοσ.

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.

Δημοσ.
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..

Δημοσ.

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.

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...