You are here: Re: How to prevent "view sourse" of php database file « PHP SQL « IT news, forums, messages
Re: How to prevent "view sourse" of php database file

Posted by J.O. Aho on 03/08/06 18:29

Mark@home wrote:
> Can anyone tell me how i can prevent that users can see my connection string
> to mysql database?

You see to that the page is processed by php and you avoid

echo "secret data: mysql_connect('example.com:3307', 'mysql_user',
'mysql_password')";

> Using my browser i could easely use the function: view source.....showing
> the html/php code.

Have you ever tried to look at the "source" of a processed php script?


> IF the file includes the connection string than anyone could see my database
> name and password.....
>
> How can i prevent this??

Include files should end with php, eg myfile.inc.php
myfile.php

If you let the php files end with .inc (or anything else than php), then you
need to modify your server settings, so that the include files are processed, eg

AddType application/x-httpd-php .inc


//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация