HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Would this work?
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Daler



Joined: 23 May 2008
Posts: 53

PostPosted: Sat Sep 13, 2008 2:04 am     Would this work? Reply with quote

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

PostPosted: Mon Oct 06, 2008 6:06 am     Reply with quote

After auick look at it, it to seems to me that's ok.

Probe it, and good luck Razz
Daler



Joined: 23 May 2008
Posts: 53

PostPosted: Mon Oct 06, 2008 8:12 am     Reply with quote

Cheers Smile

Using it to make my encryption script a bit more secure.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial