Using a variable in a header...
Moderator: General Moderators
Re: Using a variable in a header...
Have you tried printing out where the URL it's redirecting to?
Re: Using a variable in a header...
You mean echo'ing the variables? Yeh we did that they are all perfect, it just doesn't redirect right.. 
Re: Using a variable in a header...
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.
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...
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>
Ideas, anyone, im getting sort of desperate...
Re: Using a variable in a header...
What kind of PHP installation ? Wamp, Lamp, Crap ?
Re: Using a variable in a header...
Well, i have no idea what Lamp and Wamp is?
But PHP version 5.2.5 ...
But PHP version 5.2.5 ...
- novice4eva
- Forum Contributor
- Posts: 327
- Joined: Thu Mar 29, 2007 3:48 am
- Location: Nepal
Re: Using a variable in a header...
Hahahah i have this naive way of trusting this forum so i admit i did a google check on CRAP hahahahahahahapapa wrote:What kind of PHP installation ? Wamp, Lamp, Crap ?
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...
Thanks for all your help, i did it, sort of... just differently 
Thanks.
Thanks.
Re: Using a variable in a header...
Hahanovice4eva wrote:Hahahah i have this naive way of trusting this forum so i admit i did a google check on CRAP hahahahahahahapapa wrote:What kind of PHP installation ? Wamp, Lamp, Crap ?
I think we should take this post straight to UFO equivalent segment of php...HEADER didn't META did!!