Page 2 of 2

Re: Using a variable in a header...

Posted: Wed Dec 10, 2008 4:56 pm
by Jade
Have you tried printing out where the URL it's redirecting to?

Re: Using a variable in a header...

Posted: Thu Dec 11, 2008 6:49 am
by oscardog
You mean echo'ing the variables? Yeh we did that they are all perfect, it just doesn't redirect right.. :evil:

Re: Using a variable in a header...

Posted: Thu Dec 11, 2008 5:14 pm
by oscardog
Right after giving up with the header idea, i decided well i'll try using META tags... Here is the code, and i have echo'ed the variables they all work perfectly.

Code: Select all

<?php
 
$type = $_POST['type'];
$mode = $_POST['mode'];
$year = $_POST['year'];
$month = $_POST['month'];
$host  = $_SERVER['HTTP_HOST'];
$uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
 
if($type == "Planner" && $mode == "View") {
$page = "view_planner.php?month=$month&year=$year";
 
}
 
if($type == "Planner" && $mode == "Edit") {
$page = "planner_diary.php?month=$month&year=$year";
 
}
 
if($type == "Diary" && $mode == "View") {
$page = "view_diary.php?month=$month&year=$year";
 
}
 
if($type == "Diary" && $mode == "Edit") {
$page = "edit_diary.php?month=$month&year=$year";
}
 
?>
<!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="refresh" content="5;url=<?php echo $page ?>" />
</head>
 
<body>
<div align="center">You are now being redirected to the relevant page. You will be redirected in 3 seconds...<br />
  If you are not redirected, please click <a href="<?php echo $page; ?>">here</a>
</div>
</body>
</html>
 
Now, it goes from diarycentral.php where the form is to diaryprocess.php, which is the code shown above. It goes to diaryprocess.php, displays the message its redirecting bla bla and then for some STUPID reason it goes back to diarycentral.php where the form is, i mean WTF?

Ideas, anyone, im getting sort of desperate...

Re: Using a variable in a header...

Posted: Fri Dec 12, 2008 1:54 am
by papa
What kind of PHP installation ? Wamp, Lamp, Crap ?

Re: Using a variable in a header...

Posted: Fri Dec 12, 2008 4:09 am
by oscardog
Well, i have no idea what Lamp and Wamp is?

But PHP version 5.2.5 ...

Re: Using a variable in a header...

Posted: Fri Dec 12, 2008 1:36 pm
by novice4eva
papa wrote:What kind of PHP installation ? Wamp, Lamp, Crap ?
Hahahah i have this naive way of trusting this forum so i admit i did a google check on CRAP hahahahahahaha

I think we should take this post straight to UFO equivalent segment of php...HEADER didn't META did!!

Re: Using a variable in a header...

Posted: Fri Dec 12, 2008 4:31 pm
by oscardog
Thanks for all your help, i did it, sort of... just differently :)

Thanks.

Re: Using a variable in a header...

Posted: Mon Dec 15, 2008 2:32 am
by papa
novice4eva wrote:
papa wrote:What kind of PHP installation ? Wamp, Lamp, Crap ?
Hahahah i have this naive way of trusting this forum so i admit i did a google check on CRAP hahahahahahaha

I think we should take this post straight to UFO equivalent segment of php...HEADER didn't META did!!
Haha :D