Location: PHPKode > projects > The Easy Dictionary Maker > sign_do.php
<?php

/*====================================================================================================
======================================================================================================
The Dictionary Maker (TDM) is released under the GNU General Public License (GPL), which is an 
	open-source license that means anyone is free to use, modify, and 
	redistribute it, with a few restrictions. That means that the following 
	text should be included as a comment at the top of every source file:

	========================================================================
	Copyright Daniel Herman 2002

	This file is part of TDM.

	TDM is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
	
	TDM is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Beehive; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
	USA
	========================================================================
============================================================================================*/

require("./header2.php");
?>
<div align="top">
<img src="./sign_up.jpg">
</div>

<center><font face="<?php echo $style_font_face; ?>" color="<?php echo $colour_font;?>"><br><br>
<?php
$query = "SELECT * FROM $table_name_memb_temp WHERE hash = '$hash' AND mtid = '$mtid' AND uname = '$uname'";

$result = mysql_query($query, $db) or die(mysql_error());

$numRows = mysql_num_rows($result);
for ($count = 0; $count < $numRows; $count++) {
  $resultArray = mysql_fetch_array($result);

$select_id = $resultArray["mtid"];
$mail2 = $resultArray["mail"];
$uname_sql = $resultArray["uname"];
}

if(!$select_id){
echo "Sorry, the details that you have used are incorrect, if you arrived here from a link please check that you pasted all of it into the address bar, otherwise you may wish to contact your dictionary admin at <a href=\"mailto:$admin_mail\">$admin_mail</a>.";
exit;
}

$query = "SELECT * FROM $table_name_memb WHERE uname = '$uname_sql'";
$result = mysql_query($query, $db) or die(mysql_error());
$numRows = mysql_num_rows($result);


for ($count = 0; $count < $numRows; $count++) {
  $resultArray = mysql_fetch_array($result);

$test = $resultArray["uid"];

}

if($test){

echo "You have already signed up using this link!";
exit;
}

$rand_pword = rand(10000000, 1000000000);
$md5_rand_pword = md5($rand_pword);
$query = "INSERT INTO $table_name_memb (uname,pword,mail) VALUES ('$uname','$md5_rand_pword','$mail2')";
$result = mysql_query($query, $db) or die(mysql_error());

$message = "USERNAME: $uname \n PWORD: $rand_pword";

mail("$mail", "$dict_name Membership Details", $message,
     "From: $admin_mail\r\n"
    ."Reply-To: $admin_mail\r\n");

echo "Congratulations: Your account has been created your details have been e-mailed to you.";



?>
Return current item: The Easy Dictionary Maker