SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Help!

  1. #1
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    << Problem has been resolved >>

    Sorry.. I couldn't figure a title!

    I have a file, named variable.dat
    It has all the common $variables etc.
    like $name = 'name';
    $email = 'email';

    etc.

    I want to include this file into a few .php files.
    so when the php files is generating a output, it would use these variables to decide how the output should be.

    i tried include, virtual, require but what it did was printing the entire contents onto the web page~!

    ..thanks
    Last edited by lynlimz; Feb 9, 2001 at 09:36.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  2. #2
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay stupid
    I need to enclose it within <?php ?> tags
    read it in the php manual


    Thanks anyway!
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP assumes that the contents of an included file is HTML and will just send the content out to the web server.

    Thus within the included file you need to enclose your php code using the appropriate escape tags for php for your server <?php ... ?> or <? ... ?> or <% ... %>


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
  •