one sa zakodowane tutaj jest kod zrodlowy rejestracji
czesc 1
<?php
/*
$sql = 'CREATE TABLE `USER` ('
. ' `id` int(11) NOT NULL auto_increment,'
. ' `login` varchar(15) NOT NULL,'
. ' `haslo` varchar(40) NOT NULL,'
. ' `mail` varchar(40) NOT NULL,'
. ' `ranga` varchar(5) NOT NULL default 'user','
. ' `data` int(11) NOT NULL,'
. ' `ip` varchar(25) NOT NULL,'
. ' `active` int(1) NOT NULL,'
. ' `active_key` varchar(32) NOT NULL,'
. ' `ban` int(1) NOT NULL,'
. ' `cnt_view` int(255) NOT NULL,'
. ' KEY `id` (`id`)'
. ' ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 AUTO_INCREMENT=5;';
*/
include('config.php');
include('funkcje.php');
require 'info.php';
$active_user = filter($_GET['user']);
$active_key = filter($_GET['active']);
if($_POST['rejestracja'] == 'yes')
{
$login_form = filter($_POST['login']);
$mail_form = filter($_POST['mail']);
$haslo_form = filter($_POST['pass']);
$haslo_r_form = filter($_POST['pass_r']);
$reg_form = $_POST['reg'];
$token_form = $_POST['token'];
$token_true = $_POST['token_true'];
$ip = $_SERVER['REMOTE_ADDR'];
$spr_user = mysql_query("SELECT `login` FROM `USER` WHERE `login` = '$new_usr' AND ((`active` = '1') OR (`active` = '0' AND `data` - '$date' > 172800))");
$error = '';
if($spr_user == 1) {$error .= 'Podany Login jest już zajęty!<br />';}
if(empty($login_form)) {$error .= 'Musisz podać Login!<br />';} if(empty($mail_form)) {$error .= 'Musisz podać Maila!<br />';} if(empty($haslo_form)) {$error .= 'Musisz podać Hasło!<br />';} if(empty($reg_form )) {$error .= 'Jeśli nie zgadzasz się z regulaminem - odejdź!<br />';} if(strlen($login_form) > $max_login) {$error .= 'Login może zawierać MAX '.$max_login.' znaków!<br />';} if(strlen($login_form) < $min_login) {$error .= 'Login musi zawierać MIN '.$min_login.' znaków!<br />';} if(strlen($haslo_form) > $max_haslo) {$error .= 'Hasło może zawierać MAX '.$max_haslo.' znaków!<br />';} if(strlen($haslo_form) < $min_haslo) {$error .= 'Hasło musi zawierać MIN '.$min_haslo.' znaków!<br />';} if(!check_mail($mail_form)) {$error .= 'Podany Mail ('.$mail_form.') jest niepoprawny!<br />';}
if($haslo_form != $haslo_r_form) {$error .= 'Podane Hasła różnią się od siebie!<br />';}
if($token_form != $token_true) {$error .= 'Podany Token jest nieprawidłowy!<br />';}
if($error == '')
{
$add_usr = "INSERT INTO `USER` VALUES ('id', '$login_form', '".md5($haslo_form)."', '$mail_form', 'user', '$date', '$ip', '0', '$active_key', '0', '0');";
{
$komunikat = '<font color="Green">Brawo <b>'.$login_form.'</b>! rejestracja przebiegła pomyślnie! <br />Na na adres podany w formularzu został wysłany link potwierdzający rejestrację.</font><br />';
$temat = 'Potwierdzenie Rejestracji - www.chmura.go.pl';
$from = 'www.chmura.go.pl';
$headers = 'From: '.$from.'<admin@chmura.pl>'."\n";
$headers .= 'MIME-Version: 1.0'."\n";
$headers .= 'Content-Type: text/plain; charset=UTF-8'."\n";
$headers .= 'Content-Transfer-Encoding: 8bit';
$tresc = "Witaj!
Otrzymujesz tego maila ponieważ został on podany przy rejestracji w serwisie \"Chmura\",
Zapamiętaj lub zapisz tego maila, zapomniane hasło niezostanie już odzyskane!
Jeżeli uważasz że jest to wielkie nieporozumienie zlekceważ tego maila.
Twoje dane:
-----------------------------------------------------
Login: $login_form
Hasło: $haslo_form
-----------------------------------------------------
Aktywuj konto poprzez wejście w poniższy adres url:
http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']."?user=$login_form&active=$active_key
Jeśli w ciągu 48 godzin od rejestracji nie aktywujesz konta zostanie ono usunięte.
Dziękuje i pozdrawiam!
Chmura
";
mail($mail_form, $temat, $tresc, $headers); }
else
{
$error = 'Uuu wystąpiły jakieś komplikacje... spróbuj jeszcze raz za chwilę<br />';
}
}
if($error != '')
{
$komunikat = '<font color="Red"><b>Błąd!</b><br />'.$error.'</font><br />';
}
}
elseif(!empty($active_user) AND
!empty($active_key)) {
$spr_user = mysql_query("SELECT * FROM `USER` WHERE `active_key` = '$active_key' AND `login` = '$active_user'");
if($info_user['active'] == 1)
{
$komunikat = '<font color="Red">To konto zostało już aktywowane!</font>';
}
elseif($active_user == $info_user['login'] AND $active_key == $info_user['active_key'])
{
$active = "UPDATE `USER` SET `active` =' 1' WHERE `active_key` = '$active_key'";
{
$komunikat = '<font color="Green"><b>'.$active_user.'</b> Twoje Konto zostało aktywowane!</font>';
}
else
{
$komunikat = '<font color="Red">Wystąpił nieoczekiwany bład przy aktywacji konta!</font>';
}
}
else
{
$komunikat = '<font color="Red">Czas aktywacji konta uległ przedawnieniu...</font>';
}
}
?>
czesc 2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="style/screen.css" media="screen" />
<script type="text/javascript"> function ShowHide(element)
{
if(document.getElementById(element).style.display == '')
{
document.getElementById(element).style.display = 'none';
}
else
{
document.getElementById(element).style.display = '';
}
}
function Check(adres, element, id)
{
var co = document.getElementById(id).value;
advAJAX.get({url: adres+co, onSuccess : function(obj) {document.getElementById(element).innerHTML = obj.responseText; }})
}
function CheckHaslo(adres, adres2, element, id, id2)
{
var co1 = document.getElementById(id).value;
var co2 = document.getElementById(id2).value;
advAJAX.get({url: adres+co1+adres2+co2, onSuccess : function(obj) {document.getElementById(element).innerHTML = obj.responseText; }})
}
<table width="200" border="0" cellpadding="0" cellspacing="0" align="center"> <td rowspan="5"><img src="images/lewa.jpg" width="375" height="1200" /></td> <td colspan="4" valign="top"><a href="index.php"><img src="images/logo.jpg" width="420" height="146" border="0" /></a></td> <td rowspan="5" valign="top"><img src="images/prawa.jpg" width="405" height="1200" /></td> <?php include 'top_menu.php'; ?>
<td colspan="4" background="images/text.jpg" valign="top" height="250"> <?php if(isset($_SESSION['login']) AND isset($_SESSION['pass']))
{
echo 'Gratulacje, znajdujesz się na stronie dla wybranych!';
} else {
echo ?>
<form method="POST" name="RejestracjaForm"> <table class="Rejestracja" cellspacing="0" cellpadding="0"> <td colspan="2"><?php echo $komunikat; ?> </td> <td class="Rejestracja">Nazwa Użytkownika
</td> <td class="RejestracjaInput"><input tabindex="1" onblur="javascript: Check('check.php?new_usr=', 'CheckLogin', 'LoginForm');" id="LoginForm" class="Rejestracja" type="text" name="login" /></td> <td colspan="2" id="CheckLogin"></td> <td class="Rejestracja">Adres E-mail
</td> <td class="RejestracjaInput"><input tabindex="2" onblur="javascript: Check('check.php?new_mail=', 'CheckMail', 'MailForm');" id="MailForm" class="Rejestracja" type="text" name="mail" /></td> <td colspan="2" id="CheckMail"></td> <td class="Rejestracja">Hasło
</td> <td class="RejestracjaInput"><input tabindex="3" onblur="javascript: Check('check.php?new_haslo=', 'CheckHaslo', 'HasloForm');" id="HasloForm" class="Rejestracja" type="password" name="pass" /></td> <td colspan="2" id="CheckHaslo"></td> <td class="Rejestracja">Powtórz Hasło
</td> <td class="RejestracjaInput"><input name="pass_r" type="password" class="Rejestracja" id="Haslo_rForm" tabindex="4" onblur="javascript: CheckHaslo('check.php?new_haslo=', '&new_haslo_r=', 'CheckHaslo_r', 'HasloForm', 'Haslo_rForm');" /></td> <td colspan="2" id="CheckHaslo_r"></td> <td class="Rejestracja"><a href="regulamin.php">Zgadzam się z regulaminem
</a></td> <td align="center" class="RejestracjaInput"><input tabindex="5" onclick="javascript: ShowHide('PokazReg');" type="checkbox" name="reg" checked="checked" value="yes" /></td> <td colspan="2" id="PokazReg" style="display: none;"><br /> <font color="Red">Regulamin musi być zaakceptowany
</font> <td height="33" class="Rejestracja">Token
</td> <td class="RejestracjaInput"><input tabindex="6" onblur="javascript: CheckHaslo('check.php?spr_token=', '&token_true=', 'CheckToken', 'tokenForm', 'token_r');" id="tokenForm" class="Rejestracja" type="text" name="token" /></td> <td class="Rejestracja"><input type="button" onclick="javascript: location.reload();" class="RejestracjaButton" value="Zmień" /></td> <td class="RejestracjaInput" id="token"><img src="token.php?token_s=200&token_w=20&token=<?=$token_true?>" />
</td> <td colspan="2" id="CheckToken"></td> <td class="Rejestracja" colspan="2"><br /> <input tabindex="7" class="RejestracjaSubmit" type="submit" value="Rejestruj" /></td> <td class="Rejestracja" colspan="2"><br /> <input tabindex="8" class="RejestracjaSubmit" type="reset" value="Wyczyść" /> </td> <input type="hidden" name="token_true" value="<? echo $token_true; ?>" id="token_r">
<input type="hidden" name="rejestracja" value="yes"> <?php }
?>
<td colspan="4" valign="top"><img src="images/graty.jpg" width="420" height="112" /></td> <td colspan="4" valign="top"> <area shape="rect" coords="192,87,228,137" href="<?php echo $link_szafka ?>">
<img src="images/szafka.jpg" width="420" height="652" usemap="#mapa" /> </td> <?php
//echo 'Adres dokumentu to <b>http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'].'
</b><br />';
?>
EarthCitizen Twoja poprawka nie pomogla
licze na Wasza pomoc ;p