Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: secure calls to a database table?


Message #1 by Jefferis Peterson <jefferis@p...> on Tue, 6 Mar 2001 12:51:17 -0500
Jefferis

>I'm wondering about connection methods to php databases from html.

Apparently this list does not allow quoted material so here is my post
without quotations: 


I asked a friend:
what are the basic parameters when you are calling forth  data from table
on your host server?  I
know you have to make a connection script  something like this:
$connection = @mysql_connect("foma.pair.com", "jefferis" [user ], "password")

[but  I don't want others who are connecting to data on mysql table
to have to use my name an password]    How do you call a connection from
an html page that accesses one of your databases without having your admin
info involved in the connection or script?

In other words, how does a general html page make a call to a database on
pair without violating your security?

To which he replied: 

I create a single INCLUDE page - connect.inc (or .php)
Then I REQUIRE that page at the beginning of the script OUTSIDE the
functions. That way it keeps the connection open without having to
require it for each function. I dunno if this is insecure or not.

But, all the pwd info for mysql is in that include page, not on the php page.
I suppose you could put all your connect scripts into a folder and pwd
protect it. That would be smart.


and I said: Could you call the connect script from within that pwd
protected folder without using a pwd in the php page calling the connect
script? 


-- 
Jefferis Kent Peterson
www.PetersonSales.net
Flash, Web Design and Marketing 
ICQ 19112253
_______
"Happy is the person who finds wisdom, and the one who gets
understanding, for the gain from it is better than gain from silver and
its profit better than gold."  - Proverbs 3:13,14.


  Return to Index