homepage Welcome to WebmasterWorld Guest from 54.227.182.191
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Can PERL be used to load html page into a framset?
tangor




msg:435858
 1:30 pm on Mar 9, 2006 (gmt 0)

Search engines serve my content pages directly, outside of the site's frameset (yes, many will suggest getting rid of that!). Is there a method where I can insert a one line call to a cgi in each page that will cause the orphaned page to be loaded into the site's frameset? I am really interested in keeping the menus and headers static (no scrolling).

Thanks!

 

milanmk




msg:435859
 6:43 pm on Mar 9, 2006 (gmt 0)

I dont know about CGI but you can easily do this using JavaScript.

if (parent.frames.length == 0)
{
window.location.replace("/index.htm")
}

perl_diver




msg:435860
 9:45 pm on Mar 9, 2006 (gmt 0)

you probably could if you are using perl to write the frameset document to begin with. If not, I am not sure how to do it. Maybe the javascript suggestion could work.

rainborick




msg:435861
 7:17 pm on Mar 10, 2006 (gmt 0)

You can't really do this effectively server-side because you can't rely on the referrer being sent by the user's browser. JavaScript is really the best solution. Look for a script that reloads the requested frame/page into the <frameset> page and not just simply load the <frameset> with the default pages (which frustrates users because they don't see the content they expected and usually just leave). Further, if you impliment any JavaScript solution, its a good idea to include a message in a <noscript> section to guide those users to the best way to view your site.

tangor




msg:435862
 2:56 pm on Mar 11, 2006 (gmt 0)

Thanks guys! I'll try the javascript out. Haven't used javascript for much of anything on the site. Meanwhile I've updated my copyright notice, which is SSI on 95% of my pages with a clickable logo to "ENTER" the site, which will put the user where I want them to be. I'll run a dozen or so high traffic pages with the javascript and compare against a similar number of pages without the javascript and see if there's a difference.

milanmk




msg:435863
 6:23 pm on Mar 11, 2006 (gmt 0)

rainborick, I agree. Therefore, this is the required code for that.

if (parent.frames.length == 0)
{
window.location.replace("/index.htm?framepage=document.location.href")
}

You can then check for the “framepage” value in index.htm and load the requested content page in frameset.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved