Why library is visible?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Q

    Why library is visible?

    Hello,

    I have composed php file with included library:
    <?php
    include("dblib. inc");
    ........
    ........
    ?>

    And then if I open this php file with browser I see contents of
    librari. Do you know what can it be?

    Thank you.
  • Andy Hassall

    #2
    Re: Why library is visible?

    On 14 Feb 2005 13:49:49 -0800, opt_inf_env@yah oo.com (Q) wrote:
    [color=blue]
    >I have composed php file with included library:
    ><?php
    >include("dblib .inc");
    >?>
    >
    >And then if I open this php file with browser I see contents of
    >librari. Do you know what can it be?[/color]

    You've not configured your webserver to treat .inc files differently to
    anything else, so it just serves it up using some default content type, and not
    through PHP.

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Alvaro G. Vicario

      #3
      Re: Why library is visible?

      *** Q escribió/wrote (14 Feb 2005 13:49:49 -0800):[color=blue]
      > <?php
      > include("dblib. inc");
      > .......
      > .......
      > ?>
      >
      > And then if I open this php file with browser I see contents of
      > librari. Do you know what can it be?[/color]

      If the library is PHP code, just rename it to have *.php extension. E.g.:

      dblib.inc.php



      --
      -+ Álvaro G. Vicario - Burgos, Spain
      +- http://www.demogracia.com (la web de humor barnizada para la intemperie)
      ++ Manda tus dudas al grupo, no a mi buzón
      -+ Send your questions to the group, not to my mailbox
      --

      Comment

      • Wayne

        #4
        Re: Why library is visible?

        On 14 Feb 2005 13:49:49 -0800, opt_inf_env@yah oo.com (Q) wrote:
        [color=blue]
        >Hello,
        >
        >I have composed php file with included library:
        ><?php
        >include("dblib .inc");
        >.......
        >.......
        >?>
        >
        >And then if I open this php file with browser I see contents of
        >librari. Do you know what can it be?[/color]

        Wrap the code in dblib.inc in <?php ?> tags. Includes are always
        interpreted as HTML.

        Comment

        Working...