List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 6 2001 3:45am
Subject:RE: Need help on mysql/php
View as plain text  
At 7:42 PM -0500 6/5/01, Don Read wrote:
>On 05-Jun-01 Ed Peddycoart wrote:
>>  Thanks...this helped...Just had success in connecting to the MySQL server
>>  and dumping the db contents to the screen....One worrisome bit though...My
>>  username and password for connecting to the db on my host is my username and
>>  password for the web account.  If I want to create dynamic webpages by
>>  pulling data from my db, won't I have to put this information (usersname and
>>  pw) in the php file and leave it on the server?  Sounds pretty darn scary to
>>  me...maybe I am confused.
>>  Ed
>>
>
>No, you put it in a php file with nothing but defines / data,
>say 'config.php' :
>
><php
>
>// Database   ***************************
>
>define('DBHOST', 'localhost');
>define('DBUSER', 'abc');
>define('DBPASS', 'abc123');
>
>---
>
>and include('config.php') in your scripts.
>
>If the webserver is configured properly, access to this file will evaluate as
>php code; so nothing will get output.
>
>Better yet, put the file outside the $DOCUMENT_ROOT, in case your server is
>poorly configured.
>
>include("$DOCUMENT_ROOT/../config.php");

However, if you and I both have virtual domains hosted by the same server,
I can write a script that will read your config.php file.

And then, for my next trick, I'll connect to your database and read
(or destroy) all your data. :-)

>
>Regards,
>--
>Don Read                                       dread@stripped
>-- It's always darkest before the dawn. So if you are going to
>    steal the neighbor's newspaper, that's the time to do it.


-- 
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