HOw to prevent simple password readout by viewing source

Can anyone tell me how i can prevent that users can see my connection string
to mysql database?

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

IF the file includes the connection string than anyone could see my database
name and password.....

How can i prevent this??

Please help.
Mark
Mark Donners [ Mi, 08 März 2006 17:12 ] [ ID #1220532 ]

Re: HOw to prevent simple password readout by viewing source

Hello Mark!

Mark [at] home am Wed, 8 Mar 2006 17:12:42 +0100:

> Can anyone tell me how i can prevent that users can see my connection string
> to mysql database?
>
> Using my browser i could easely use the function: view source.....showing
> the html/php code.
>
> IF the file includes the connection string than anyone could see my database
> name and password.....

The source you see in your browsers source-view is the html-source the
script produced and not the php-source of the script itself.

Usually there is no need to mention account-information in the
html-source because such information is used internally inside the
script.

Do you really see the information in the html-source or are you just
afraid that it might happens?

Greeting

Bodo

--
Bodo Kaelberer [ Mi, 08 März 2006 17:54 ] [ ID #1220533 ]

Re: HOw to prevent simple password readout by viewing source

Mark [at] home wrote:
> Can anyone tell me how i can prevent that users can see my connection string
> to mysql database?
>
> Using my browser i could easely use the function: view source.....showing
> the html/php code.
>
> IF the file includes the connection string than anyone could see my database
> name and password.....
>
> How can i prevent this??
>
Write your connection settings in a file outside of your webservers
document root and include that file with php.

best regards, Hendrik
Hendrik Pilz [ Fr, 10 März 2006 16:29 ] [ ID #1224055 ]
PHP » de.comp.lang.php.datenbanken » HOw to prevent simple password readout by viewing source

Vorheriges Thema: NEUE Software und IT-Bücher mit 60% und mehr Nachlass
Nächstes Thema: komplexe Sortierung