SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    upland
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing Variables to a frameset

    I want to link from an html page to a frameset that has a nav bar in a top frame and a dynamic PHP page in the main frame( I am using frames because I want the viewer to have the nav bar accesible at all times while scrolling through the products. I am sending a variable via a link off of the html page as so: <a href="frameset.php?ID=player>DivX Players</a>. The nav bar (top frame) is loading, but the main frame comes up blank as if the variable has not been passed. The PHP code in the requested page works when called up by itself ,but not as part of a frameset. What do I need to do to send a variable and have it go through a frameset into a frame source?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Your frameset.php page should output a frame src for the main frame including the ID variable there as well. You essentially need to pass the variable twice -- from your link to the frameset, from the frameset to the frame.

  3. #3
    SitePoint Member
    Join Date
    Nov 2004
    Location
    upland
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the advice, but I am still confused.

    I don't know how to pass the variable from the frameset to the frame source..

    I have tried
    <?
    $ID=$_get('ID')
    ?>

    in the beginning of the frameset with a

    <frame src="catalog_new.php?ID=$ID>

    etc......


    Do I need quotes around the string in the frame source tag or do I need to echo with PHP????

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    <frame src="catalog_new.php?ID=<? echo $_GET['ID']; ?>">

  5. #5
    SitePoint Member
    Join Date
    Nov 2004
    Location
    upland
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do I still need the <?
    $ID=$_get('ID');
    ?>

    at the top?

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kageboy2003
    Do I still need the <?
    $ID=$_get('ID');
    ?>

    at the top?
    No, there's no need for that. If you tried it, you'd find out that the variable is $_GET not $_get, and that you don't access arrays using parentheses, so the whole thing would die with an error anyway.

  7. #7
    SitePoint Member
    Join Date
    Nov 2004
    Location
    upland
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are a lifesaver!!!!! I had tried everything and I knew that I was just coding the frame source tag wrong but didn't know why. Thanks again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •