Location does not work
Posted: Wed Feb 03, 2010 10:49 am
In the following code:
The location does not redirect my webpage. Why?
Code: Select all
<?php
$mysql_id = mysql_connect('localhost', 'xxx', 'xxx');
mysql_select_db('mariolopes',$mysql_id);
session_start();
$aluno=$_SESSION['nome'];
//--regista as horas na base de dados
$query="INSERT INTO registo_horas (Aluno,Data,N_horas,Confirmado) VALUES ('$aluno',$_POST[data],'$_POST[horas]','N')";
$result=mysql_query($query);
if(!$result){
echo mysql_error();
}
$query="select sum(N_horas) as total from registo_horas";
$result=mysql_query($query);
session_start();
while($row=mysql_fetch_array($result)){
$_SESSION['horas']=$row['total'];
}
header( 'Location= registohoras.php');
?>