
3rd April 2006, 18:23
|
|
Senior Member
|
|
Join Date: Sep 2005
Location: UK, East Midlands
Posts: 515
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
PHP > MYSQL to protect a page
What I am wanting to do is use a php page to ask for a username and password that is stored in a mysql database.
My plan was to use a username and password to connect to the mysql database that only has read access.
However what is to stop anyone from looking at the source of the php page and finding the username and password I have used to connect to the database and using it to get all the usernames and passwords stored.
I will be hosting the page on my own ISPConfig web hosting server.
Can anyone help.
Thanks
|

3rd April 2006, 19:45
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
|
|
Quote:
|
Originally Posted by mphayesuk
However what is to stop anyone from looking at the source of the php page and finding the username and password I have used to connect to the database and using it to get all the usernames and passwords stored.
|
The PHP script (better: Apache) will only deliver HTML code to your browser, not PHP code. So you can specify the username and password in your PHP file.
|

4th April 2006, 15:35
|
|
Junior Member
|
|
Join Date: Apr 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Indeed, and if you are thinking about inputting the username/password into further pages I would say use sessions.
If however you are referring to the fact that you are using an ISPConfig web hosting server, and the question relates to that. As in: can those others users of the server access my source. Then yes, they can via shell access or if they are an administrator. Unless you compile your php (dont ask me how, i've never done it ;-))
|

5th April 2006, 22:25
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 172
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ya Apache is good and go to piratebay.org and in "other" there is a torrent of 300 excellent PHP scripts.
|

6th April 2006, 17:17
|
|
Senior Member
|
|
Join Date: Sep 2005
Location: UK, East Midlands
Posts: 515
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
22hosting... I see what you mean with the users... I will be keeping the source code under my own web space so no other uses except me can view the original files... I will take a look into sessions and compiling php... thanks for the posts... I have just bought a php book so I am sure I can come up with something.
Thanks
|

7th April 2006, 00:15
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
|
|
Quote:
|
Originally Posted by mphayesuk
I will be keeping the source code under my own web space so no other uses except me can view the original files...
|
Make sure all other web sites use PHP Safe Mode, otherwise their owners could write a PHP script that reads your files...
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 15:59.
|
Recent comments
2 hours 22 min ago
8 hours 10 min ago
10 hours 2 min ago
11 hours 46 min ago
15 hours 37 min ago
21 hours 22 min ago
21 hours 33 min ago
1 day 1 hour ago
1 day 7 hours ago
1 day 12 hours ago