49 users online (1 members and 48 guests)  


  Results 1 to 8 of 8

Related

  1. What is your favorite Singer .??    Forum: General Discussion
    Replies: 28
  2. Transparent Frameset Background.    Forum: HTML Forum
    Replies: 2
  3. Doubt in <frameset>    Forum: HTML Forum
    Replies: 1
  4. Replies: 2
  5. Replies: 1
  1. #1
    annmartinson's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Location
    Spokane, WA USA
    Posts
    15

    how to make the mid of a frameset add to a favorite bookmark?

    I've got a client who has insisted we re-vamp an existing site inside frames, which I've never worked with before and never want to again.

    One of the things I hate about frames is the difficulties with navigation, and specifically the fact that on every page I've ever been to with frames, on refresh I get to the beginning page, and when bookmarking it, I end up with a link to the beginning page.

    Is there a way around this? If I knew what to call it, I'd be happy to search for it ...


    thx.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    ...frames...shudder...

    But heres a workaround that a member here showed us once -

    PHP Code:
    <frame src="<% 

    if (
    $_GET['middle'] != "") {
    echo 
    $_GET['middle'] . ".php";
    } else {
    echo "
    default.php";
    }
    %>"

    Then set your favourites code to something similar to

    http://mysite.net/index.php?middle=page5

    In effect, bodging a fix thru the actual framset page.

    Of course, don't forget not to have a 'naked' filename in the querystring. Risky.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    lol. Working with too much asp lately. Substitute <% with <?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  4. #4
    annmartinson's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Location
    Spokane, WA USA
    Posts
    15
    sorry to be so dense, but I almost understand your answer, but not quite

    in my frame source page now I have:
    PHP Code:
    <?php
    //this is the file that starts the frames
    echo "<html>\n";
    echo 
    "<head>\n";
    echo 
    "<title>The City Source - Spokane, Washington</title>\n";
    echo 
    "</head>\n";
    echo 
    "<frameset rows=\"37,*,22\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
    echo 
    "<frame src=\"topnav.php\" name=\"top\" framespacing=\"0\" frameborder=\"0\" border=\"0\" scrolling=\"no\">\n";
    echo 
    "<frame src=\"/pages.php?cat=".$cat."&id=".$id."\" name=\"mid\" framespacing=\"0\" frameborder=\"0\" border=\"0\" scrolling=\"auto\">\n";
    echo 
    "<frame src=\"bnav.php\" framespacing=\"0\" frameborder=\"0\" border=\"0\" scrolling=\"no\">\n";
    echo 
    "<NOFRAMES>\n";
    echo 
    "<P>Here is the <A href=\"/main-noframes.php?nofr=1?cat=".$cat."&id=".$id."\">non-frame based version of the document.</A>\n";
    echo 
    "</NOFRAMES>\n";
    echo 
    "</frameset>\n";
    echo 
    "</html>\n";
    ?>
    which to me looks like what you have suggested ... do I post your code as a part of the interior page or somewhere else?

    and re the bottom part about favorites code ... I think that's the part I need to understand ... you're telling me how to set the favorites code on teh page, right?

    where does this part go? ... in the header, style part, body or wherever

  5. #5
    annmartinson's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Location
    Spokane, WA USA
    Posts
    15
    forgot ... explain this part too please ... don't quite get that either ...
    Of course, don't forget not to have a 'naked' filename in the querystring. Risky.
    thanks so much.

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    No worries, Ann.

    The code suggested (badly, was in a rush ) above was an example of how to add to favourites. This will only work if you are using an 'Add Page to Favourites' link, usually JavaScript. Quick tutorial - http://www.htmlgoodies.com/beyond/addtofavs.html

    However, the code was designed originally so that you could send Links out that got you straight to a 'page within frames' other than the default one.

    Looking at your code, it looks as if you have pretty much a similar system setup already (with the $cat ) so if this information is gathered from a querystring, you are already there. Its a case of making those links available, check out the tutorial above.

    As a normal user, dragging the link into their favourites, this approach will not work sorry.


    As to the risky part, if you put a page to display into the hands of the user (in other words, in the address/querystring) then they could grab pages they should not have access to. Its more dangerous with a php include, really, but always good to be safe
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  7. #7
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    add to favourites

    <script language="JavaScript">

    var bookmarkurl="http://url/"
    var bookmarktitle="website_name"

    function addbookmark(){
    if (document.all)
    window.external.AddFavorite(bookmarkurl,bookmarktitle)
    }
    </script>

    <a href=# onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www26.brinkster.com/zerofc/');">Set as homepage</a>

  8. #8
    annmartinson's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Location
    Spokane, WA USA
    Posts
    15
    I appreciate your help, however, I'm recognizing that I'm going to have to do some more studying about java before I can start to put this in ... I have no clue where any of this should go ... will go look around for some beginner explanation stuff on java and then will come back and see if I can apply this.

    my problem of course is that it has to be incorporated into the php code and include variables, etc. ... so ...


    will post my success, but likely will be DAYS

    thx.



Tags for this Thread