Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 7 of 7
  1. #1

    PHP using Includes, how do I create links?

    I'm building a website in PHP, and I'm new to PHP. I've read that the best way to do it is to have a main file that includes the header.php and footer.php files, then calls a page using if statements and includes. My question is, what do you do for links? Let say I have my main file as index.php, I want to call aboutus.php if the About Us link is clicked, otherwise it will call home.php. What would the About Us link URL be?

  2. #2
    Top Of My Head's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    10
    Downloads
    0
    Uploads
    0
    <div id="header">
    <?php
    include('header.php');
    ?>
    </div>

    <div id="header">
    <?php
    include('body.php');
    ?>
    </div>

    <div id="footer">
    <?php
    include('footer.php');
    ?>
    </div>

    -Billy

  3. #3
    Top Of My Head's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    10
    Downloads
    0
    Uploads
    0
    <div id="header">
    <?php
    include('header.php');
    ?>
    </div>

    <div id="header">
    <?php
    include('body.php');
    ?>
    </div>

    <div id="footer">
    <?php
    include('footer.php');
    ?>
    </div>

    -Billy

  4. #4
    Top Of My Head's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    10
    Downloads
    0
    Uploads
    0
    <div id="header">
    <?php
    include('header.php');
    ?>
    </div>

    <div id="header">
    <?php
    include('body.php');
    ?>
    </div>

    <div id="footer">
    <?php
    include('footer.php');
    ?>
    </div>

    -Billy

  5. #5
    Top Of My Head's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    10
    Downloads
    0
    Uploads
    0
    <div id="header">
    <?php
    include('header.php');
    ?>
    </div>

    <div id="header">
    <?php
    include('body.php');
    ?>
    </div>

    <div id="footer">
    <?php
    include('footer.php');
    ?>
    </div>

    -Billy

  6. #6
    Top Of My Head's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    10
    Downloads
    0
    Uploads
    0
    <div id="header">
    <?php
    include('header.php');
    ?>
    </div>

    <div id="header">
    <?php
    include('body.php');
    ?>
    </div>

    <div id="footer">
    <?php
    include('footer.php');
    ?>
    </div>

    -Billy

  7. #7
    Top Of My Head's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    10
    Downloads
    0
    Uploads
    0
    <div id="header">
    <?php
    include('header.php');
    ?>
    </div>

    <div id="header">
    <?php
    include('body.php');
    ?>
    </div>

    <div id="footer">
    <?php
    include('footer.php');
    ?>
    </div>

    -Billy

 

 

Quick Reply Quick Reply

Click here to log in


What is the number after 87?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 11-29-2011, 01:09 PM
  2. Trailers for Upcoming Movies (includes links)
    By lynaem in forum Discuss Movies
    Replies: 180
    Last Post: 08-20-2010, 12:25 PM
  3. Replies: 0
    Last Post: 09-04-2009, 01:49 AM
  4. Replies: 0
    Last Post: 07-22-2009, 05:52 PM
  5. How to use PHP includes?
    By daisyflower_x in forum Discuss PHP
    Replies: 0
    Last Post: 06-10-2009, 03:10 PM

Bookmarks

Posting Permissions

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