List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 7 2001 12:12pm
Subject:RE: Need help on mysql/php
View as plain text  
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, paul@stripped
Thread
Need help on mysql/phpEd Peddycoart5 Jun
  • RE: Need help on mysql/phpJorge Oliveira5 Jun
    • RE: Need help on mysql/phpEd Peddycoart5 Jun
      • RE: Need help on mysql/phpJorge Oliveira5 Jun
        • RE: Need help on mysql/phpPaul DuBois6 Jun
          • RE: Need help on mysql/phpEd Peddycoart6 Jun
            • RE: Need help on mysql/phpPaul DuBois6 Jun
          • RE: Need help on mysql/phpKenneth Kopelson6 Jun
            • RE: Need help on mysql/phpPaul DuBois6 Jun
        • RE: Need help on mysql/phpSommai Fongnamthip6 Jun
      • RE: Need help on mysql/phpDon Read6 Jun
        • RE: Need help on mysql/phpPaul DuBois6 Jun
        • RE: Need help on mysql/phpNeil Zanella6 Jun
  • Re: Need help on mysql/phpB. van Ouwerkerk5 Jun
  • Re: Need help on mysql/phpOlexandr Vynnychenko5 Jun
RE: Need help on mysql/phpJorge Oliveira6 Jun
  • RE: Need help on mysql/phpEd Peddycoart6 Jun
RE: Need help on mysql/phpIan Ford7 Jun
  • RE: Need help on mysql/phpNeil Zanella7 Jun
  • RE: Need help on mysql/phpAdrian D'Costa7 Jun
    • RE: Need help on mysql/phpPaul DuBois7 Jun