At 2:13 PM +0530 6/7/01, Adrian D'Costa wrote:
>On Wed, 6 Jun 2001, Ian Ford wrote:
>
>>  Name your config file config.inc and if any of the below situations
>>  happen your password and username will not show up in plain text for the
>>  casual browser.
>>  (EXAMPLE:
>>
>>      CONFIG.INC
>>      <?
>>              $DBname = 'test';
>>              $DBuser = 'imatest';
>>              $DBpass = 'Whatever';
>>              $DBhost = 'localhost';
>>      ?>
>>
>>      INDEX.PHP
>>      <?
>>              require("config.inc");
>>              $conn = mysql_connect($DBhost,$DBuser,$DBpass);
>>                        mysql_select_db($DBname);
>>      ?>
>>
>>  END EXAMPLE)
>>  You can place the config.inc any where you want. My preference is in a
>>  includes folder...
>
>Actually I tried this out sometime ago and found that it appears as a
>plain text file.  This I believe is because the webserver know that .php
>or .php3 should be treated as a php file and other in which ever way it
>can display.

That only applies to the extension of the top-level file.  Included
files can have any extension.  You do, however, have to surround the
text of the included file with <?php ?> or <? ?> or whatever tags you
use.  That might have been your problem.

-- 
Paul DuBois, [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to