Reply
PHP reload page to frames
Old 01-02-2003, 06:07 AM PHP reload page to frames
DaveTodd's Avatar
Evil Psycho Alien

Posts: 684
Location: Sheffield, England
I've already tried solving this in javascript (thankx dk01!) but with little joy, so I'm hoping that php can solve my problem...

this page is indexed by the search engines.

Unfortunately, the site uses frames. People go to the competition page, but don't get the frames, because the engines link directly to the competition page.

I'm looking for a script that will reload the competition page into the frameset, whilst keeping the competition page as the main frame (content frame).

Does anyone have a script / could write a script that would do this?

Many thanks
__________________
take care,
Dave ;)
SafariQuip - Mosquito Nets, Travel + Safari Equipment Online
DaveTodd is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-02-2003, 09:07 AM
Abhishek Reddy's Avatar
Average Talker

Posts: 28
Location: New Zealand
I don't know the history and circumstances of your problem, but here's a thought: why use frames at all? Especially if you have PHP at your disposal.
__________________
Abhi
Moderator at The Webmaster Forums
Abhishek Reddy is offline
Reply With Quote
View Public Profile
 
Old 01-02-2003, 09:37 AM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Yes I think that is a good idea also but I guess its up to you!
Anyways here is a way to do it with php:

Ok... Php cannot detect whether or not frames are loaded, so you will still have to use javascript to do that.

1) You can use this code on the competitions page:

<script language="JavaScript">
if(!(parent.frames.length > 0))
{
window.location.href = "http://www.safariquip.co.uk/vivid/frames.html?url="+ window.location.href;
}
</script>

It should will redirect you back to your frameset page but will have ?url=http://www.safariquip.co.uk/vivid/pages/comp/comp.html
on the end of it.

2) now you will have to change your frames page (currently frames.html) to frames.php

3) Then you will need to replace this:
<FRAMESET ROWS="*" COLS="152,*" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
<FRAME NAME="menu" SCROLLING="NO" NORESIZE="NORESIZE" SRC="menu/menu.html"
MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
<FRAMESET ROWS="76,*" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
<FRAME NAME="banner" NORESIZE="NORESIZE" SCROLLING="NO"
SRC="banners/check.html" MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
<FRAME NAME="content" SRC="pages/front/front.html"
MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
</FRAMESET>
</FRAMESET>


With this:
<?php if(!$url) { $url = 'pages/front/front.html'; } ?>
<FRAMESET ROWS="*" COLS="152,*" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
<FRAME NAME="menu" SCROLLING="NO" NORESIZE="NORESIZE" SRC="menu/menu.html"
MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
<FRAMESET ROWS="76,*" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
<FRAME NAME="banner" NORESIZE="NORESIZE" SCROLLING="NO"
SRC="banners/check.html" MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
<FRAME NAME="content" SRC="<?php echo($url); ?>"
MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
</FRAMESET>
</FRAMESET>


I really hope this works out for you!
-dk
__________________
Did I help you? If so, be nice and throw me some TP

Last edited by dk01 : 01-02-2003 at 09:42 AM.
dk01 is offline
Reply With Quote
View Public Profile Visit dk01's homepage!
 
Old 01-02-2003, 09:53 AM
DaveTodd's Avatar
Evil Psycho Alien

Posts: 684
Location: Sheffield, England
ROAR!!!

and the scripting bursts into life!! it works just implimented + tested it, i'll have to check it over with my boss, but if he's okay with it, it'll go live officially on Saturday.

the url for the test page so you can see for yourself is http://www.safariquip.co.uk/vivid/pages/comp/comp2.html

it should redirect automatically to http://www.safariquip.co.uk/vivid/frames2.php

let me know how you get on testing it, any bugs / problems etc. please report them to me.

many thankx for the prompt response...and the correct answer dk01!!
__________________
take care,
Dave ;)
SafariQuip - Mosquito Nets, Travel + Safari Equipment Online
DaveTodd is offline
Reply With Quote
View Public Profile
 
Old 01-02-2003, 07:23 PM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
It had to eventually come! Thank goodness. Working for me
-dk
__________________
Did I help you? If so, be nice and throw me some TP
dk01 is offline
Reply With Quote
View Public Profile Visit dk01's homepage!
 
Old 06-08-2003, 11:19 AM
Junior Talker

Posts: 2
Great help thanks a lot - one small querry - how come I can reload to frames php pages such as
http://brianhouston.com/html/modules...ics&file=index
I just get an error - it doesnt process them correctly
Any ideas how i can avoid this?
Thanks for the help
tudorbob is offline
Reply With Quote
View Public Profile Visit tudorbob's homepage!
 
Old 06-08-2003, 05:01 PM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
I'm sorry. Maybe its me but I haven't really understood how that link is relavent. Could you be more clear?
Thanks
-dk
__________________
Did I help you? If so, be nice and throw me some TP
dk01 is offline
Reply With Quote
View Public Profile Visit dk01's homepage!
 
Old 06-09-2003, 04:12 AM The Link
Junior Talker

Posts: 2
The link is the one i am trying to reload using the script above. the script works great for urls such as index.php, user.php but not one with modules.php?op=modload&name=Topics&file=index - what i mean is I dont think this url gets processed corrdectly when using the code given - it comes back with errors but accessing it normally is fine.

I hope that clears up the question - simple php links work but more complex calls dont.

Any suggestions on how to avoid this.
Thanks
tudorbob is offline
Reply With Quote
View Public Profile Visit tudorbob's homepage!
 
Reply     « Reply to PHP reload page to frames
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15029 seconds with 12 queries