Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd April 2006, 18:23
mphayesuk mphayesuk is offline
Senior Member
 
Join Date: Sep 2005
Location: UK, East Midlands
Posts: 517
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via MSN to mphayesuk
Default 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
Reply With Quote
Sponsored Links
  #2  
Old 3rd April 2006, 19:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 4th April 2006, 15:35
22hosting 22hosting is offline
Junior Member
 
Join Date: Apr 2006
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

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 ;-))
________
DinaSky

Last edited by 22hosting; 22nd August 2011 at 13:59.
Reply With Quote
  #4  
Old 5th April 2006, 22:25
sbovisjb1 sbovisjb1 is offline
Senior Member
 
Join Date: Feb 2006
Posts: 176
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ya Apache is good and go to piratebay.org and in "other" there is a torrent of 300 excellent PHP scripts.
Reply With Quote
  #5  
Old 6th April 2006, 17:17
mphayesuk mphayesuk is offline
Senior Member
 
Join Date: Sep 2005
Location: UK, East Midlands
Posts: 517
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via MSN to mphayesuk
Default

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
Reply With Quote
  #6  
Old 7th April 2006, 00:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
 
Default

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...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Downgrade php5 to php4.4.2 llizards Installation/Configuration 4 14th March 2006 00:58
all my site go to /var/www/ Absolusteph Installation/Configuration 14 11th March 2006 22:27
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 17:04
Compatibility php & mysql HSorgYves Installation/Configuration 1 21st November 2005 22:19
MySQL support in PHP tobi Installation/Configuration 3 2nd May 2005 23:20


All times are GMT +2. The time now is 16:14.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.