Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Include problem

  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Include problem

    Hi,

    It seems that my include doesn't work right.
    Can someone check what i did wrong?

    The file: here

    Thanks,
    NVDW

  • #2
    Regular Coder
    Join Date
    Jun 2005
    Posts
    804
    Thanks
    0
    Thanked 0 Times in 0 Posts
    .rar?

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's probably working, it's just that you're declaring the <html>, <head> and <body> tags again within the include file which is probably making your browser's head hurt.

    You only need to put the data in test.php that you want to appear, you don't need to redeclare all the html tags as these are in the calling file already.

    Try just removing everything except "test" and see if it shows up then. If it still doesn't work, try changing your include to this:

    <?php include("include/test.php"); ?>

    It could be that you don't have short tags enabled in the php.ini so it's not parsing it as PHP but as html instead, which would appear hidden in the browser since it's between <> tags. It's good practice to use <?php instead of the short tag <? format anyway, since it makes your code more portable.

  • #4
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, I tried everything you said but it still isn't working.
    I removed the html and everything: didn't work
    I did <?php: didn't work

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    your folder is called includes not include
    PHP Code:

    <?php include("includes/test.php");?>

  • #6
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes i saw it, i changed it to but still nothing, i also uploaded the files again

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    It works on my server, does the content.php file even parse on your server? Who is your host?

  • #8
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys, it works fine now
    Thanks for the fast replies


  •  

    Posting Permissions

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