organizing my website

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganich
    New Member
    • Apr 2007
    • 2

    organizing my website

    Hello,
    i am looking for a Php script which could help me in organising my website.

    Ok the problem ...

    i have created index.html and made full layout in it. I use iframe in a table to view the pages which are navigated on the index.html..i hope u understand..its just like a index.html has all the links and those links open in that iframe page..

    now i create a page ..contactus.htm l and only put the contact numbers in this page.

    now the link to this page is on index.html nagivation menu... obviously when somebody will click contactus link which will be targetted to the iframe the page will open in the frame.i hope u get it till here..

    the problem is that when somebody will open www.website.com/contactus.html only this page will open...we won't be able to see the layout which is in index.html...

    i cannot avoid frames because whenever i will have to update the layout i will have to update all the pages..and neither i can use css layouts because i am not mastered in CSS Layouts..i dnt know much abt them and have done alot of research on them using google but still cannot produce good layouts..

    on many sites i have seen PHP Include type on command..the orignal page contains just small info but when u open like... www.website.com/contactus.php it will open with the layout which is on index.php.. the navigation links are like are like ..contactus.php/?include/news something..blah blah..there is something like that..i want to know step by step how can i do this in php..

    i want a create seperate pages with proper titles and meta tags but it should open in a table with proper layout page..no matter from where you open it and the page title should change with it.....

    remember i am going to use the same index.php layout page for multi pages, like contact.php about.php all should open with index.php..


    Please let me know how can we do this in PHP..
    any help would be appreciated
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    First of all, please read the Posting Guidelines and avoid using meaningless titles like "Help required" in your future posts.

    As for your question, I think there are two ways to force a page into a frameset.

    In your server PHP code look at $_SERVER['HTTP_REFERER'] and compare it to the url of the frameset.
    Then use the header function, if necessary to reload page in the frame.

    The same effect can be achieved on the client side using a small javascript code, which you can put in the HEAD section of each page that must be displayed in the frame.
    Here are some crude code samples to illustrate the idea.

    Code:
    <script language="javascript" type="text/javascript">
    // 1
    if (top.location == location) {
        // window is loaded directly
         window.location.href = frameset.html;
    }
    
    // 2
    if (self == top) {
        // window has no parent, loaded directly
         window.location.href = frameset.html;
    }
    
    // 3
    if (top.location != my_frameset_url) {
        // reload in the frameset 
         top.location.href = my_frameset_url;
    }
    </script>
    You may need to refine this code a bit, folks in the Javascript forum can help you to make it perfect.

    Comment

    Working...