Hi,
I've a stupid question but...
The code is the following:
if(($role!='tut or')&&(array_ke y_exists('tutor _id',$_GET)))
{
$possible_ids = array(2,6,7,8,9 ,10);
$t_id = $_GET['tutor_id'];
if(in_array($t_ id, $possible_ids)) {
$query="SELECT id_class FROM class WHERE
id_user='".$_GE T['tutor_id']."'";
$id_class=$db->get_field($que ry,id_class);
include("print_ data.php");
$formButtonLabe l = "Modifica";
}
--->else
{
//$my_echo = "hello";
//echo $my_echo;
//header('Locatio n: http://www.google.com' );
//exit();
}
}
What happens:
if in the array there's what you have in $_GET, anything works.
It's the else block that matters: :-)
- if I ONLY print $my_echo, no problems;
- if I comment $my_echo and I leave the header() uncommented, this
command doesn't work (that is, the page does not redirect);
What is happening?
How can I solve this?
I tried (in the else block) the headers_sent function too:
if (headers_sent() ) {
$my_echo = "sent";
echo $mioeco;
}
and it seems headers are sent, but maybe before I try to redirect.
Is there a way to "clean" the headers already sent??
Thanks very much,
Platero
I've a stupid question but...
The code is the following:
if(($role!='tut or')&&(array_ke y_exists('tutor _id',$_GET)))
{
$possible_ids = array(2,6,7,8,9 ,10);
$t_id = $_GET['tutor_id'];
if(in_array($t_ id, $possible_ids)) {
$query="SELECT id_class FROM class WHERE
id_user='".$_GE T['tutor_id']."'";
$id_class=$db->get_field($que ry,id_class);
include("print_ data.php");
$formButtonLabe l = "Modifica";
}
--->else
{
//$my_echo = "hello";
//echo $my_echo;
//header('Locatio n: http://www.google.com' );
//exit();
}
}
What happens:
if in the array there's what you have in $_GET, anything works.
It's the else block that matters: :-)
- if I ONLY print $my_echo, no problems;
- if I comment $my_echo and I leave the header() uncommented, this
command doesn't work (that is, the page does not redirect);
What is happening?
How can I solve this?
I tried (in the else block) the headers_sent function too:
if (headers_sent() ) {
$my_echo = "sent";
echo $mioeco;
}
and it seems headers are sent, but maybe before I try to redirect.
Is there a way to "clean" the headers already sent??
Thanks very much,
Platero
Comment