Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    14
    Member #
    16135
    I’ve built a simple web site and I have a problem.

    When you click on a link in the left frame it opens the link in the main section of the page like it’s supposed to but the URL stays the same. So no matter what link you click, unless you open the link in a new page the URL remains the same (the main index.htm file)

    For example if I click on “Family Pictures” or “Photography” the URL in the address line remains www.thelamberts.com

    This is a problem because I would like to be able to send links to people from time to time.

    How can I correct this problem? Is there a bit of code I can add?


    Here’s the site
    http://www.thelamberts.com

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    You'll have another problem with <frames> ...

    Even if you send them the link called: http://www.thelamberts.com/canning.htm

    If they open up that link, they will see that whole page in their browser,
    not inside the frame.

    The only way they will be able to see your website with the URL
    inside the frame is to go to your website and click on the link.

    ===============

    That's where PHP comes in.

    If you were to use PHP scripting, you could eliminate that <frame> and
    use an inline frame instead ... <iframe>

    <frame> and <iframe> are 2 different things. You really shouldn't use
    either, but <iframe> would be the better choice for your application.
    I suggest <iframe> because you're displaying a whole different HTML page
    within your main page, so the operation would appear the same as now,
    except the HTML for "index.php" would be as a whole, not a remote frame.

    Your link would contain a variable code attached to the URL, which would
    determine which page to put into the inline frame.

    Example, the link you send to your family member would look something like this:
    http://www.thelamberts.com/index.php?p=3

    When your "index.php" page loads, it would see the page code of 3 and
    automatically insert page 3 (canning.htm) into the inline frame.

    You always want to use a code and DO NOT do something like this:
    http://www.thelamberts.com/index.php?url=canning.htm

    Doing that would allow someone to display any URL in your website.

    ==============

    If I had more time, I would provide an actual working example for you.


  4. #3
    Junior Member
    Join Date
    Nov 2007
    Posts
    14
    Member #
    16135
    You always want to use a code and DO NOT do something like this:
    http://www.thelamberts.com/index.php?url=canning.htm
    Doing that would allow someone to display any URL in your website.
    Im not sure what you mean by this could you explain? Would you be willing to provide me with a very simple example of you iframes you are talkinga about? Maybe just 2 frames with one link. I should be able to figure it out from there. Thanks again for your responce.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Before you start using PHP, you should know that you can't
    view your webpages offline because it needs the server to
    generate the PHP scripting. Is that OK with you?

    So, you would need to make changes, upload the pages, and
    view online to see your changes.

    Right now, I'm guessing you're using Dreamweaver offline to create
    your pages, viewing them, and uploading them later on.

    EDIT:

    Cut and paste this PHP script into notepad, save as "test.php" and
    upload it into your main directory.

    PHP Code:
    <?php
    $page
    =$_GET['p'];
    $url="Main.htm";
    if(
    $page == 1){
    $url="canning.htm";
    }
    if(
    $page == 2){
    $url="photos.htm";
    }
    ?>
    <html>
    <head><title>Your index.php page here</title>
    </head>
    <body>
    <div style='width:200px; float:left;'>
    <?php
    if($page == 1){
    echo 
    "<b>Canning</b>\n";
    }
    else{
    echo 
    "<a href='test.php?p=1'>Canning</a>\n";
    }

    if(
    $page == 2){
    echo 
    "<b>Photography</b>\n";
    }
    else{
    echo 
    "<a href='test.php?p=2'>Photography</a>\n";
    }
    ?>
    </div>
    <div style='width:500px; float:left;'>
    <iframe name='frame1' src='<?=$url?>' frameborder='0' scrolling='no' width='500' height='600'></iframe>
    </div>
    </body>
    </html>
    Now, go to the URL ... http://www.thelamberts.com/test.php

    It should display "Main.htm" in the <iframe>

    If you go to this URL ... http://www.thelamberts.com/test.php?p=1

    If should display "canning.htm" in the <iframe>

    PHP with the navigation not only displays the correct page in the <iframe>
    but handles the link properties of the link itself, so the page you're viewing
    is <bold> and not a link.

    ==========


  6. #5
    Junior Member
    Join Date
    Nov 2007
    Posts
    14
    Member #
    16135
    Once I add an include to a page dreamweaver only shows that page in the design area. Anyway to make it show the rest of the page

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    I don't use Dreamweaver, so I'm not sure what the question means.
    Maybe someone else might answer.


  8. #7
    Junior Member
    Join Date
    Nov 2007
    Posts
    14
    Member #
    16135
    Thanks for your input folks! I converted the site from frames to PHP with INCLUES. Works much better and I think it looks better too!

    My problem with Dreamweaver allowing me to edit in Design view turned out to be a formatting problem with the PHP code. You would think Dreamweaver would format its on code in such away that this wouldn’t happen! Then again it was probably something I wasn’t doing right

    Anyway take a look at the updated site and let me know what you think.

    http://www.thelamberts.com

    Thanks again,
    Alan

  9. #8
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Good job!

    You'll find a gazillion uses for PHP.

    Now, you need to learn CSS and try working the site without <tables>

    But it looks nice ... learn CSS on the side (maybe a different part of your site).


  10. #9
    Junior Member
    Join Date
    Nov 2007
    Posts
    14
    Member #
    16135
    I'm actully already working on it! Good suggestion.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:21 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com