SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Include statement and CSS... help appreciated

    Hey,

    Here is my dilemma. I have a PHP template file which has a header and a footer defined by CSS code. I also have a content section which is dynamically filled (using an include) in depending on PHP code determing what link a user clicks.
    PHP Code:
    echo '<div id="main_text">';
    include(
    $link); 
    echo 
    '</div>'
    As you can see I am outputting whatever link within a CSS div to format it properly. This works great, when a user clicks a link the correct page is displayed correctly between the header and footer. However, if the $link page has a link on it, when a user clicks that link it opens in its own window and not within my template.

    For example, on my $link I automatically generate links for each letter of the alphabet. Then if a user clicks one letter it grabs records from a database. This works, however when a user clicks a letter it opens in its own screen and doest open within the template.

    Is there any way around this, anyone have any clue what I am even trying to say??

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,439
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    include

    I think you may be a bit confused as to what include does. It is not meant to be used as a type of frame. It is sort of like whatever is in the include file is inserted into the code where the include line is. This happens before the page is rendered. After the page is rendered it behaves like any HTML page. Links work like they would in a static HTML page.


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
  •