www.webdeveloper.com
Results 1 to 4 of 4

Thread: Help me to figure out this funny error!

  1. #1
    Join Date
    Apr 2005
    Posts
    210

    Help me to figure out this funny error!

    2 files: menu.tpl and help.php

    menu.tpl has been included in another file, looks like:
    Code:
    <div ....>
       include menu.tpl here (pseudo code)
    </div>
    followings are all code in menu.tpl and help.php

    help.php:
    Code:
    <?php ?>
    menu.tpl:
    Code:
    <?php require_once("help.php"); ?>
    <div id="absolute-menu">
    	<div style="width:200px; height:20px;"></div>
    </div>
    If I delete first line <?php require_once("help.php"); ?> in menu.tpl, whole project works fine.
    But with the line, project stopped at this point - I saw it by "view source" of firefox.

    Could you analyze reason for this?
    I am new to php, I guess <?php require_once("help.php"); ?> can not be put inside a <div>.

    Any more rules about using php include?

    Thanks.

    .

  2. #2
    Join Date
    Apr 2005
    Posts
    210
    I figure it out!

    <?php require_once("help.php"); ?> doesn't include help.php even they are in the same directory!


  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,157
    Try this to see if you get more info:
    PHP Code:
    <?php
    ini_set
    ('display_errors'true);
    error_reporting(E_ALL);
    require_once(
    "help.php"); 
    ?>
    <div id="absolute-menu">
        <div style="width:200px; height:20px;"></div>
    </div>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    Unless you configure your server to interpret .tpl files as php then no php will actually be executed.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles