SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    819
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile Include function not working

    I have the following include function:
    <?php
    include ('styling/brfooter.inc');
    ?>

    in my file: file:///C:/Reactor/htdocs/BRH%20folder/BRH/index.html

    Problem is, my "brfooter.inc" file is not appearing. The location of the "brfooter.inc" file is under file:///C:/Reactor/htdocs/BRH%20folder/BRH/styling/brfooter.inc (where Reactor/htdocs/ is the operating server on my machine.

    Am I missing something on how to script the "brfooter.inc" file in my include script? I thought I had it right by the way I've been reading in books.

    Any help would be greatly appreciated!
    Toad78
    Last edited by toad78; May 5, 2005 at 14:18. Reason: forgot something

  2. #2
    orange pips! orange pips!
    Join Date
    Oct 2001
    Location
    Its all about location
    Posts
    652
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to change the extension on your index.html page to be index.php. Otherwise, the web server won't know that you are processing php and need to include a file.

  3. #3
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As krayzie put you have to have a .php extension on your file.

    You do have a local server setup with PHP on your machine right? If not, you won't see anything where the PHP code should execute.

    I can't find it now but there is a thread going on now about different applications that will install Apache, PHP, MySQL on your local machine to set up a 'localhost'.

    If you are unable to find it, I've always had luck with AppServ.
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't find it now but there is a thread going on now about different applications that will install Apache, PHP, MySQL on your local machine to set up a 'localhost'.

    If you are unable to find it, I've always had luck with AppServ.
    Wamp Server works great, and has some good plugins.

  5. #5
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    819
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by krayziepjf
    You need to change the extension on your index.html page to be index.php. Otherwise, the web server won't know that you are processing php and need to include a file.

    Thank you...I'll try that right away!

    Toad78

  6. #6
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    819
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by k0ng
    Wamp Server works great, and has some good plugins.
    Actually, someone gave me Reactor Server which installed and set up my system automatically as a localhost. It came with PHP, MySQL, Apache, etc. etc. It seems to have worked out well for me. Thank you for the advice, though!

    Toad78

  7. #7
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, WAMP5 really rocks.

    It's my prefered offline server.



    BTW, why don't you try using the function require_once().

  8. #8
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    819
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by SUPERUSER
    Yes, WAMP5 really rocks.

    It's my prefered offline server.



    BTW, why don't you try using the function require_once().
    Haven't gotten that far in my instruction booklet, yet. I know it covers it, I just haven't read about it.

    Toad78

  9. #9
    SitePoint Guru
    Join Date
    Jul 2003
    Location
    england
    Posts
    819
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by krayziepjf
    You need to change the extension on your index.html page to be index.php. Otherwise, the web server won't know that you are processing php and need to include a file.
    Thank you! Works great now! hmm...wonder if I missed out changing the extension in my instruction booklet. ~

    Toad78

  10. #10
    SitePoint Evangelist dmsuperman's Avatar
    Join Date
    Feb 2005
    Location
    A box
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For those of you who want all of it, GD, a mailer, an ftp server, php 4 and 5, apache 2, mysql, all of it, get XAMPP
    It also has SSL and tons of cool installed stuff, best out of the ones I've tried, and I tried WAMP and AppServ.
    <(^.^<) \(^.^\) (^.^) (/^.^)/ (>^.^)>
    Core 2 Duo E8400 clocked @ 3.375GHz, 2x2GB 800MHz DDR2 RAM
    5x SATA drives totalling 2.5TB, 7900GS KO, 6600GT


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
  •