i'm trying to create a registration page, taking nic, email and password - but each time i enter a password the mdf() funtion returns the same hash, regardless of the password string it is given. the page is at http://www.adamhopkinson.co.uk/lone.php - try it out for yourself...
thanks, adam
<?php
include 'vars.php';
if($nic != "" AND $email != "" AND $password != "") {
$md5password = md5($password);
$link = mysql_connect($hostname,$username,$password) or die("Could not connect");
mysql_select_db($database) or die("Could not select db");
$query = "insert into " . $dbprefix . "users (userid, nic, password, email) VALUES ('', '$nic', '$md5password', '$email')";
echo $query;
//$result = mysql_query($query) or die("Could not query");
} else {
if($submit) {
echo "Please make sure all entries have been completed";
}
?>
<br>
<br>
<form method="POST" action="lone.php">
Nic<br>
<input type="text" name="nic" value="<?php echo $nic ?>" size="20" class="formfield"><br>
Email<br>
<input type="text" name="email" value="<?php echo $email ?>" size="20" class="formfield"><br>
Password<br>
<input type="password" name="password" value="<?php echo $password ?>" size="20" class="formfield"><br>
<input type="submit" value="Submit" name="submit">
</form>
<?php
}
?>