1

ANSWER: Was a problem with web hosting.

This is my code

<!DOCTYPE html> 
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
        <meta name="description" lang="en" content="Test Website " /> 
        <meta name="author" content=""> 
        <link rel="stylesheet" type="text/css" href="css/style.css">
        <title</title>
    </head>
    <body>
        <section id="wrapper">
            <?php include('includes/topHeader.php'); ?>
            <?php include('includes/leftSide.php'); ?>
            <?php include('includes/middleSide.php'); ?>
            <?php include('includes/rightSide.php'); ?>
        </section>

        <?php include('includes/foot.php'); ?>
        </section>
    </body>
</html>

question the other php files not appear in the main page?

to create it I have use this website http://www.1stwebdesigner.com/css/how-to-create-php-website-template/

Update View Source shows:

<section id="wrapper">

<!--?php include('../includes/topHeader.php'); ?-->
<!--?php include('../includes/leftSide.php'); ?-->
<!--?php include('../includes/middleSide.php'); ?-->
<!--?php include('../includes/rightSide.php'); ?-->

</section>

<!--?php include('../includes/foot.php'); ?-->
30
  • 1
    Swap the include to require. I imagine that the files aren't in the directory you think they're in. Commented Jul 3, 2013 at 15:59
  • 1
    You have a closing "</section>" tag without an opening. Commented Jul 3, 2013 at 16:01
  • 1
    @Steve There is another closing </section> beside the closing </body> Commented Jul 3, 2013 at 16:03
  • 1
    In the source the php files covered in comments like <!-- php code --> Commented Jul 3, 2013 at 16:11
  • 1
    Maybe your PHP error reporting is turned off by default. Overwrite with error_reporting(E_ALL); ini_set('display_errors', '1'). Commented Jul 3, 2013 at 16:11

2 Answers 2

1

You are using the include function right, so please make sure that:

  • Files you are trying to include really exists, you can test with file_exists function
  • You don't have any fatal errors somewhere in the files that stops the execution of your program (you can check error log)
  • Your markup is well formatted (in some cases when code is not formated correctly browsers cannot render the page correctly)
Sign up to request clarification or add additional context in comments.

Comments

0

On a quick note apart from what was already suggested. Try

<?php include('../includes/topHeader.php'); ?>
<?php include('../includes/leftSide.php'); ?>
<?php include('../includes/middleSide.php'); ?>
<?php include('../includes/rightSide.php'); ?>

I say this with an assumption that the include folder resides above the current file in the folder structure.

8 Comments

Judging by the tutorial that Denis linked to, that's not the folder structure.
opps sorry I didnt check the tutorial.
No worries. It's a good thought, anyway, and usually an effective sanity-check in situations like this.
Try debugging it using firebug. Check the Net TAB and resolve the path accordingly.
Don't forget to revert back to <?php include('includes/topHeader.php'); ?> before testing any other suggestions. I noticed the code at jsfiddle.net/K7sQn is still using <?php include('../includes/topHeader.php'); ?>
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.