RE: Need help on mysql/php

2001-06-06 Thread Ian Ford

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

Thank you,

Ian Ford
Northwest Link
Web Development

-Original Message-
From: Neil Zanella [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 12:09 PM
To: Don Read
Cc: Ed Peddycoart; Mysql@Lists. Mysql. Com; Jorge Oliveira
Subject: RE: Need help on mysql/php



On Tue, 5 Jun 2001, Don Read wrote:

 Better yet, put the file outside the $DOCUMENT_ROOT, in case your
server is
 poorly configured.

 include($DOCUMENT_ROOT/../config.php);

This is a very good idea. One day if the system administrator decides to
back up all the user data and upgrade the web server and forgets to
include support for PHP then all the PHP files become readable as plain
text and casual web surfers could sniff your password. Another scenario
where this could happen is if there are two web servers and your home
directory is mounted on both via NFS or AFS and you may not be aware
that
the other web server does not have PHP support.

If you are serving from /home/httpd/html then store your database access
information including passwords in some directory like
/home/httpd/secret
and set the right ownerships for that directory and files therein. It is
also a good idea to control extraneous access to the database by
firewalling your site.

Neil


-
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


-
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




Importing

2001-04-02 Thread Ian Ford

I'm tring to import a text file to mysql. The problem I am having is
that the mysql database is located on a seperate server from the web
site. I can do query's and inserts but I can not get the mysql server to
grab a txt file from the web server and load it into the database. I
have been using the following code:
 
$query = "LOAD DATA LOCAL INFILE '$tmp\\$file1_name' ";
 $query .= "INTO TABLE usr FIELDS ";
 $query .= "TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'
(name,email,login,active,defaultpw)";
 
The site is located on an NT server and the database is on a UNIX
server. Not sure if that matters or not.
 
Any help would be great..
 
Ian