Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member GeZe's Avatar
    Join Date
    Dec 2003
    Posts
    330
    Member #
    4381
    This is the simplist PHP in the world, yet it doesn't work.

    For: www.codebluestudios.com

    Header
    in the title element:
    PHP Code:
     <?php 
            
    echo ("$title");
    ?>
    Footer
    in the link:
    PHP Code:
     <?php if($category == 'home'){ print('id=\"side_nav_select\"');}?>
    Page
    top of page:
    PHP Code:
    <?php

    //define everything
    $title 'codeblue studios - intelexual web design';
    $category 'home';

    include (
    'http://www.codebluestudios.com/header.php');


    ?>
    bottom of page:
    PHP Code:
     <?php
    include ('http://www.codebluestudios.com/footer.php');
    ?>
    the stuff is included, but the variables aren't working. the title isn't printed, and also the category isn't printed
    -GeZe

  2.  

  3. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    The include() should not include a file via http but as simple as the full path on the server. For example:

    PHP Code:
    //define everything
    $title 'codeblue studios - intelexual web design';
    $category 'home';
    include 
    "/full/path/to/header.php"
    See what that does.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  4. #3
    Senior Member GeZe's Avatar
    Join Date
    Dec 2003
    Posts
    330
    Member #
    4381
    tried it and it doesn't work

    thanks anyway though

    the problem isn't that it isn't getting included, the HTML is, the problem is that the variables aren't getting through, the variable on the page aren't getting carried over to the include or something like that. I'm not sure.
    -GeZe

  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Yep - when you use http:// it will include the RESULT of the script, not the script itself.

    Use as ekstreme mentioned... you probably have the wrong absolute path.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    To find out the full correct path, in the PHP file you are including stuff, type the following:

    PHP Code:
    echo dirname(__FILE__); 
    and then browse to it. You will the full path, and the last directory or two should be recognizable as part of your website root directory structure. Modify them to reflect where the header and footer files really are (if needed) and then used that to include the files.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  7. #6
    Senior Member GeZe's Avatar
    Join Date
    Dec 2003
    Posts
    330
    Member #
    4381
    both of you are god! thank you! I would give you guys turtle dollars but I only have 1 left.
    -GeZe


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com