chippy
01-19-2007, 01:53 PM
Hi all,
I'm a bit of a newbie at php and web building
Is it at all possible using the header("Location:) redirect to target a frame on my site, specifically the main frame.
Basically I created several html pages in dreamweaver ( r1.html, r2.html, r3.html....) each page resides in its own /dir with its own index.php page as below:-
<?php
//Date & Time redirection
//Retrieve the current date/time.
$timenow=strtotime("NOW");
// Set the r1 cutoff date & time.
$r1_end=strtotime( "2007-04-05 17:35" );
//If the current date and time is before the r1 cutoff date & time.
if ($timenow <= $r1_end){
//Redirect to r1.html page.
header("Location:http://mysite.com/r1/r1.html");
}
//Else if the current date and time is after the r1 cutoff date & time.
elseif ($timenow >= $r1_end){
//Redirect to "sorry you missed it" page.
header("Location:http://mysite.com/sorry.html");
}
?>
Each of these pages ( r1.html, r2.html, r3.html.....etc.) has a dropdown menu/list box on it which has a http:// link to the index.php for each /dir.
Hope I'm making sense so far.
Now the problem I'm having is, the r1.html page opens up in the main frame no problem, but if I use its dropdown menu to select r2.html or any other page, they all open up outside of the frame in the whole window and I have to use the browser back button to get back to the site.
I have tried using the:-
<head>
<base target="main">
</head>
on each .html page but it doesn't work.
I'm sure its something really basic, but for the life of me I can't figure it out.
Any help is much appreciated
cheers
chip
I'm a bit of a newbie at php and web building
Is it at all possible using the header("Location:) redirect to target a frame on my site, specifically the main frame.
Basically I created several html pages in dreamweaver ( r1.html, r2.html, r3.html....) each page resides in its own /dir with its own index.php page as below:-
<?php
//Date & Time redirection
//Retrieve the current date/time.
$timenow=strtotime("NOW");
// Set the r1 cutoff date & time.
$r1_end=strtotime( "2007-04-05 17:35" );
//If the current date and time is before the r1 cutoff date & time.
if ($timenow <= $r1_end){
//Redirect to r1.html page.
header("Location:http://mysite.com/r1/r1.html");
}
//Else if the current date and time is after the r1 cutoff date & time.
elseif ($timenow >= $r1_end){
//Redirect to "sorry you missed it" page.
header("Location:http://mysite.com/sorry.html");
}
?>
Each of these pages ( r1.html, r2.html, r3.html.....etc.) has a dropdown menu/list box on it which has a http:// link to the index.php for each /dir.
Hope I'm making sense so far.
Now the problem I'm having is, the r1.html page opens up in the main frame no problem, but if I use its dropdown menu to select r2.html or any other page, they all open up outside of the frame in the whole window and I have to use the browser back button to get back to the site.
I have tried using the:-
<head>
<base target="main">
</head>
on each .html page but it doesn't work.
I'm sure its something really basic, but for the life of me I can't figure it out.
Any help is much appreciated
cheers
chip