473,788 Members | 2,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to protect password for mysql_connect in php script?

7 New Member
I am adding some database driven functionality to my web site and will need a php script like to sample below to connect to the database. I have found some solutions for protecting the password by storing it in a file outside the web directory. But my web-hosting is a shared linux account @ Go Daddy and I don't appear to have access outside the root. Any suggestions for how I can secure the password?

Thanks
Gary

<?php
$link = mysql_connect(' localhost', 'mysql_user', 'mysql_password ');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';.
mysql_close($li nk);
?>
Nov 25 '07 #1
3 2612
assimlation
9 New Member
you can't go to the directory below public_html ?
Nov 25 '07 #2
Markus
6,050 Recognized Expert Expert
I don't think you should worry about it really..

Just save it in a directory 'library'

I dont see how someone would get access to it..
Nov 25 '07 #3
ak1dnar
1,584 Recognized Expert Top Contributor
The end users (web browser) will get the generated HTML out put only. They can't see the source codes. No matter about, inside or out side public root. anyhow the hosting company can read them all. If it is a problem for you, there are so many Third party tools to encode your php scripts. but sure the execution of the php engine will slow down on this process. but still the hosting company guys can access the database. no way to prevent it. but if you want to prevent, the only way is, use your own Server to host the Application.
Nov 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4199
by: Phil W | last post by:
Hi, I'm a bit of a newbie to PHP and mySQL. I'm trying to get things running on my W2K machine. I'm having a problem using the mysql_connect() function (although the problem's probably rooted in mysql). When trying to log in via PHP with the code "$link = mysql_connect("localhost", "phil", "pwpass123");" I get the error... Warning: mysql_connect() : Access denied for user: 'phil@localhost' (Using password: YES) in...
2
2359
by: Flier_75 | last post by:
Hi, I just password-protected an intranet site by including a password authentication script in each page of a private section. The script checks the login against the mySQL database. Appropriate file permissions have been set up on the private directory. My concern is now about protecting the Mysql password. Let's assume I use Apache to protect the access to this password (<files></files> or SetEnv in httpd.conf).
11
3369
by: siliconmike | last post by:
Is there a way to protect data files from access by root ? I have a data-centered website and would like to protect data piracy from any foot-loose hosting company employee. Any ideas? Thanks Mike
3
3331
by: Narlen | last post by:
Hi there, I don't know much about web design but I proudly managed to password protect a page on my site. Later I realized that everyone looking at the source in any web browser can see the password. Is there a way to improve this code so that instead of the password people viewing the page source would only see bullets instead of the characters of the password (or hide it alltogether?) Thank you for your help.
4
2228
by: David LACASSAGNE | last post by:
Is it possible to set a password to protect the code of an Access VBA project by automation (I already know how to to it manually)? David.
22
5829
by: teejayem | last post by:
Hi, I am new to programming with databases and was wanting some help. Is there any way to password protect an access database and access sent sql commands to it via vb.net code? Any help would be much appreciated. Thanks in advanced.
8
2052
by: Sheik Ishmael | last post by:
Hi, I'm trying to get password recognition calling data froma table called users('user_name' and 'user_password' using the below (bottom of page) code. However, I get the following warning from my browser "Parse error: parse error, unexpected ';' in /data/members/paid/g/l/ glastonburytv.eu/htdocs/www/check_password.php3 on line 19 This is the line I have replaced my password with "MY PASSWORD"
2
1888
by: sharmilah | last post by:
I have the following code in my script and it's giving a syntax error at line *** when using the password function. My password in the mysql database is encrypted using the password function itself and I want to verify the input password against my database password. PLEASE HELP if (isset($_POST)) $password = @$_POST; if (($login != "") && ($password != "")) { $conn = mysql_connect("localhost", "root", "root"); ...
5
6098
by: Shmuel | last post by:
Hello, Is it possible to give to mysql_connect an encrypted (md5 or sha1) password? If not is there a workaround? I store passwords for users in database and don't want to use plain text passwords. Then I use that information to connect to the database. So every user have his own database.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10374
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10121
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5539
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4076
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.