1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

PHP Hyperlinks from menu

Discussion in 'Web Development' started by LarsL, Jan 13, 2010.

  1. LarsL

    LarsL New Member

    Hello,
    I've downloaded a template, the CoD-template cause I like the colors and the setup of it.
    But now my question:
    On the left I got the menu, I edited all hyperlinks, no problem, but how I edit it, that if you click on "members" for example, that it plops in the middle of the site, where previously the news were? I don't want it to load in a new frame, just in the middle of the site...

    Thanks, and sorry for my bad english.
     
  2. Olaf

    Olaf New Member

    Do you have a link? I don't think that they offer framed templates here...
     
  3. CovertPea

    CovertPea Moderator Staff Member Verified Member

  4. LarsL

    LarsL New Member

    Hiho, yes, it's this one.
    OK, so the answer is I have to cut it into frames, thanks ;-)
     
  5. enigma1

    enigma1 New Member

    you could use some ajax and get the content for a member and display it in the middle or the links on the member pics could load a page with the member info.

    The part in the middle that need to change could read a parameter from the link clicked to identify the member. Some server side script could load the information from the dbase and send it to the browser.

    eg:
    Code:
    <?php
    $members_query = mysql_query("SELECT member_title, member_info WHERE member_id='" . (int)$_GET['mID'] . "'");
    
    if(mysql_num_rows($members_query) == 1) {
      $members_array=mysql_fetch_array($members_query);
       echo[FONT=monospace] '[/FONT]<div class="postheader"><h1>' . $members_array['member_title'] . '</h1></div>';
       echo[FONT=monospace] '<[/FONT]div class="postcontent">' . $members_array['member_info'] . '</div>';
    }
    ?>
    
    so basically the code retrieves the member info from the dbase and prints it. You could enclose the code in a div where the news are so they can be overridden
    postheader and postcontent divs are the ones used by the template for header/content
     
  6. Olaf

    Olaf New Member

    there are so many possibilities to do that one is Ajax or just use the template for each page, using PHP you can create a template that holds all the navigations like:

    Code:
    head
    
    content
        sidebar
        <Your dynamic content>
    
    footer
    This is how many content management systems work (like Wordpress), you create functions or server side includes which are used in every file of your website.
    But this is much harder stuff than working with frames (don't do that). Frames are the Internet from 90's and no one should use them anymore.

    If you need help on how to create that kind of dynamic website, check Google or use some CMS and create a template for this system.