•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 374,612 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,430 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1012 | Replies: 6
![]() |
•
•
Join Date: Jan 2006
Posts: 53
Reputation:
Rep Power: 3
Solved Threads: 0
•
•
•
•
may i ask if it is ok to create a $password variable with my real password as the string? it seems like mysql_real_escape_string() won't work because this function only works after the connection is made, but i've also read that php code is not actually viewable by a user...
I always wondered this myself,
But im not sure so you could just encrypt it anyway, there are functions in PHP that do this.
Last edited by Barnz : Sep 6th, 2006 at 7:17 pm.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,873
Reputation:
Rep Power: 32
Solved Threads: 108
Find the encrypted value of your password string and do $encrypted_password = '**********';
Then, do a check against md5($entered_password) == $encrypted_password. This way, if someone gains FTP access, or another user on your server, won't know what your password is.
Then, do a check against md5($entered_password) == $encrypted_password. This way, if someone gains FTP access, or another user on your server, won't know what your password is.
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Sep 2006
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I'm not sure if we're talking about the same thing. I THINK you might be referring to a form where a user logs in with a password, whereas I am trying to write a script which takes $_POST data and enters it into an INSERT query using the username and password in mysql_connect().
[php]
$hostname="blah.blah.net";
$username="blahblahjunior";
$password="blahblahblah";
$dbname="blahbase";
$usertable="blahusers";
$con = mysql_connect($hostname,$username, $password);
[/php]
i.e. is the $password string in the php file used to connect to the database ever visible/hackable by an outside user.
p.s. yer cute
[php]
$hostname="blah.blah.net";
$username="blahblahjunior";
$password="blahblahblah";
$dbname="blahbase";
$usertable="blahusers";
$con = mysql_connect($hostname,$username, $password);
[/php]
i.e. is the $password string in the php file used to connect to the database ever visible/hackable by an outside user.
p.s. yer cute
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,873
Reputation:
Rep Power: 32
Solved Threads: 108
Ah, you're right. I was referring to a password being entered in a form. In such a case, entering the password in plain text is the only alternative I know of, since md5() and sha1() are both one-way encryption algorithms.
Last edited by cscgal : Sep 6th, 2006 at 9:19 pm.
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
I asked the same question several months ago.
Here's the thread:
http://www.daniweb.com/techtalkforums/thread48057.html
Users of Mozilla and Firefox may want to right click and select "Open in new Tab" especially if they're browsing with tabs now.
Here's the thread:
http://www.daniweb.com/techtalkforums/thread48057.html
Users of Mozilla and Firefox may want to right click and select "Open in new Tab" especially if they're browsing with tabs now.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
- Forgot XP password (Windows NT / 2000 / XP / 2003)
- What password manager software for XP? (Windows Software)
- Win 98se & bios update with Bin file (Windows 9x / Me)
- admin password in win xp (Windows NT / 2000 / XP / 2003)
- win2k locks up (Windows NT / 2000 / XP / 2003)
- How to set up password to keep Windows from starting??? (Windows NT / 2000 / XP / 2003)
- Windows 2000 Password Expired (Windows NT / 2000 / XP / 2003)
- Forgot computer password (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: How to get state selected country using php
- Next Thread: Using HTML tags in PHP code



Linear Mode