 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Daler
Joined: 23 May 2008 Posts: 53
|
Posted: Sat Sep 13, 2008 2:04 am Would this work? |
|
|
|
I have this line of code, which will encrypt user info into a mysql database.
But I want it to just encrypt one preset username and password. (It's going to be used in a webpage encryption script, while at the moment it is a site registration script.)
This is the code at the moment:
| Code: |
<?php
define("DB_SERVER", "localhost");
define("DB_USER", "your_name");
define("DB_PASS", "your_pass");
define("DB_NAME", "your_db");
define("TBL_USERS", "users_table_name");
$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $connection) or die(mysql_error());
...
function addNewUser($username, $password){
global $connection;
$password = md5($password);
$q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password')";
return mysql_query($q, $connection);
}
?> |
I want to change:
| Code: |
| function addNewUser ($username, $password) |
To my own username and password, but I'm not sure if it will then let me retrieve them when I log in. Will it work? |
|
coberr
Joined: 28 Feb 2007 Posts: 29
|
Posted: Mon Oct 06, 2008 6:06 am |
|
|
|
After auick look at it, it to seems to me that's ok.
Probe it, and good luck  |
|
Daler
Joined: 23 May 2008 Posts: 53
|
Posted: Mon Oct 06, 2008 8:12 am |
|
|
|
Cheers
Using it to make my encryption script a bit more secure. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|