ciao a tutti, ho questo codice:
codice:
<?php
$host = "localhost";
$username = "root";
$password = "";
$db_name = "iscrizione";
$tbl_name = "utenti";
//Procedimento per connettersi al database
mysql_connect("$host", "$username", "$password") or die ("Cannot connect");
mysql_select_db("$db_name") or die ("Cannot select DB");
//Nome utente e password inviate attraverso il form
$myusername = $_POST['myusername'];
$mypassword = $_POST['mypassword'];
$sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result = mysql_query($sql);
//Mysql_num_row is counting table row
$count = mysql_num_rows($result);
//If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
//Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Attenzione username o password errati";
}
?>
che mi controlla se un utente fa il login con username e password giuste al centro pagina mi stampa la scritta login successful. Il problema adesso sorge, quando in questa pagina voglio metterci un menu .swf sopra e uno sotto.
Quando immetto username e password che stanno dentro al db, mi esce quest'errore:
codice:
Warning: session_register() [function.session-register]: Cannot send session cookie - headers already sent by (output started at C:\wamp\www\modulo\checklogin.php:4) in C:\wamp\www\modulo\checklogin.php on line 28
Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\modulo\checklogin.php:4) in C:\wamp\www\modulo\checklogin.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\modulo\checklogin.php:4) in C:\wamp\www\modulo\checklogin.php on line 30
Anche se faccio un include di questa pagina mi da lo stesso errore. Mi potete dire come mai?