Yardımcı olursanız sevınırım .
Kodlar ;
<html>
<?php
function DeCode($string,$operation,$key='')
{
$key=md5($key);
$key_length=strlen($key);
$string=$operation=='D'?base64_decode($string):substr(md5($string.$key),0,8).$string;
$string_length=strlen($string);
$rndkey=$box=array();
$result='';
for($i=0;$i<=255;$i++)
{
$rndkey[$i]=ord($key[$i%$key_length]);
$box[$i]=$i;
}
for($j=$i=0;$i<256;$i++)
{
$j=($j+$box[$i]+$rndkey[$i])%256;
$tmp=$box[$i];
$box[$i]=$box[$j];
$box[$j]=$tmp;
}
for($a=$j=$i=0;$i<$string_length;$i++)
{
$a=($a+1)%256;
$j=($j+$box[$a])%256;
$tmp=$box[$a];
$box[$a]=$box[$j];
$box[$j]=$tmp;
$result.=chr(ord($string[$i])^($box[($box[$a]+$box[$j])%256]));
}
if($operation=='D')
{
if(substr($result,0,8)==substr(md5(substr($result,8).$key),0,8))
{
return substr($result,8);
}
else
{
return'';
}
}
else
{
return str_replace('=','',base64_encode($result));
}
}
?>
<?php
session_start();
$UserID=$_GET["UserID"];
$Password=$_GET["Password"];
$Email=$_GET["Email"];
$UserName=$_GET["UserName"];
$***=$_GET["***"];
$IDCard=$_GET["IDCard"];
$mt2regCode=$_GET["mt2regCode"];
$code=$_SESSION["code"];
$Ques=$_GET["Ques"];
$Ques=DeCode($_GET["Ques"],'E','daichao');
$Answ=DeCode($_GET["Answ"],'E','daichao');
$BirthYear=$_GET["BirthYear"];
$BirthMonth=$_GET["BirthMonth"];
$BirthDay=$_GET["BirthDay"];
$Addr=$_GET["Addr"];
$PostCode=$_GET["PostCode"];
$Mobile=$_GET["Mobile"];
$Telephone=$_GET["Telephone"];
?>
<?php
if (strlen($UserID) < 8) {$error=$error."<br>Kullanıcı Adı Kullanılıyor Yada Geçersiz ";}
if (strlen($Password) < 9) {$error=$error."<br>Şifre 9 Harften Küçük";}
if (strlen($Email) < 1) {$error=$error."<br>Email Adresini Kontrol Ediniz";}
if (strlen($UserName) < 1) {$error=$error."<br>Ad'ınızı Girin";}
if (strlen($IDCard) != 7) {$error=$error."<br>Karakter Silme Kodu Giriniz Yada 7 Rakam Yapiniz";}
if (strlen($Answ) < 1) {$error=$error."<br>Güvenlik Cevabi Giriniz";}
if (strlen($error) > 0){
echo "Kontrol Ediniz <a href=\"javascript:history.back();\">Geri Dön</a>$error";exit;
}else{
require_once("conn.php");
mysql_select_db("account");
$exec="select * from account where Login='$UserID'";
$result=mysql_query($exec);
$rs=mysql_fetch_object($result);
if($rs){
echo"Hesap Kullanılıyor<a href=\"javascript:history.back();\">Geri Dön</a>";
exit;
}else{
$exec="insert into account (Login,Password,Real_name,Social_id,Email,Phone1,Phone2,Address,Question1,Answer1) values('$UserID',password('$Password'),'$UserName','$IDCard','$Email','$Mobile','$Telephone','$Addr','$Ques','$Answ')";
mysql_query("set names big5 ");
mysql_query("set CHARACTER big5 ");
mysql_query($exec);
//echo mysql_error();
//echo $exec;
//$exec="insert into player.safebox(account_id,size,password) values((select id from account.account where login='$UserID') ,1,'000')";
//mysql_query($exec);
//echo mysql_error();
//echo "<br>".$exec;
?>
<code>
Başarıyla Kayıt Oldunuz .
</code>
<?php
}
}
?></html>Mysql'e Sifreyi Kaydederken Orda ;
password($password)Var.
Sanırım password diye değişken atanmıs.neyse bi türlü cozemedım istediğim
girilmiş şifrenin algoritmayla dönüştürülmüş halini ekrana nasıl yazdırabileceğim ?
Umarım Anlatabilmisimdir.Yardımcı olursanız sevınırım