Wchodzi sie w profil na stronie www
Klikasz Rozpocznij procedurę zmiany E-maila
Przychodzi ci na e-mail wiadomość taka http://wklej.to/w1jef
tylko problem jest w tym ze ten link co przyjdzie nie działa próbowałem to poprawić na różne sposoby i nie idzie mi mam trudności z ogarnięciem tego
a oto Mój skrypt http://domenaaax/profile.php?id=changeemail
Oto Skrypt
Wszystkie tabelki typu sid2/sid2_time/sid3/sid_time/email_nawe_status posiadam w bazie danych
<?php if(user_logged() !== 'yes') { set_info($lang['logged_if'], 'warning'); } else { load_headline('changeemail'); $u = get_user_data(); $user = $_SESSION["USER_LOGIN"]; $ip = $_SERVER['REMOTE_ADDR']; $expire = $time - 3600; safe_sql("UPDATE ".$config['db_account'].".account SET email_new='0', email_new_status='0', sid3='0', sid3_time='0' WHERE Login='$user'"); set_info("Procedura została anulowana, link wygasł, czas oczekiwania przekroczył 1 godzine.", 'error'); } else { if($_GET['step']==1 and isset($u['sid3']) and $u['sid3']<>'0' and $u['email_new_status']=='step-1' and $u['sid3']==$_GET['sid']) { echo'<form method="post" action="'.$config['site_url'].'profile.php?id=changeemail'.$u['sid3'].'">'; echo'<table border="0" width="100%" cellspacing="0" cellpadding="5" align="center" class="pod_wood"> <tr><td align="right" class="row1">Nowy Email </td><td class="row2"> <input type="text" name="new_email" maxlenght="100"></td></tr> <tr><td align="right" class="row2">Nowy Email, powtórz </td><td class="row1"> <input type="text" name="re_new_email" maxlenght="100"></td></tr> <tr><td align="center" class="row1" colspan="2"> <input type="submit" name="send" value="Zmień Email" style="cursor:pointer;"></td></tr> '; $new_email = $_POST['new_email']; $re_new_email = $_POST['re_new_email']; $query_e = mysql_num_rows(safe_sql("SELECT email FROM ".$config['db_account'].".account WHERE email='$new_email'")); if($new_email == '') { $err = 'Wpisz Email'; } elseif(!preg_match("/^[^.]+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $new_email)) { $err = 'Email jest nieprawidlowy'; } elseif($query_e>=1) { $err = 'Podany Email jest juz zajety'; } else { safe_sql("UPDATE ".$config['db_account'].".account SET sid3='$sid', sid3_time='$time', email_new_status='step-2', email_new='$new_email' WHERE Login='$user'"); load_lang('mail'); $message = $lang['changeemail_step1_message']; $mailheader = "FROM: xxx.pl <no-reply@xxx.pl> \n"; $mailheader .= "MIME-Version: 1.0\n"; $mailheader .= "Content-Type: text/html;\n"; $mailheader .= "\tcharset=\"UTF-8\"\n"; $mailheader .= "Content-Transfer-Encoding: 8bit\n\n"; set_info($lang['change_email_step1_start'], 'passed'); } set_info($err, 'error'); } } } safe_sql("UPDATE ".$config['db_account'].".account SET sid3='$sid', sid3_time='$time', email_new_status='step-3' WHERE Login='$user'"); load_lang('mail'); $message = $lang['changeemail_step2_message']; $mailheader = "FROM: xxx.pl <no-reply@xxx.pl> \n"; $mailheader .= "MIME-Version: 1.0\n"; $mailheader .= "Content-Type: text/html;\n"; $mailheader .= "\tcharset=\"UTF-8\"\n"; $mailheader .= "Content-Transfer-Encoding: 8bit\n\n"; set_info($lang['change_email_step2_start'], 'passed'); } safe_sql("UPDATE ".$config['db_account'].".account SET sid3='0', sid3_time='0', email_new_status='0', email='".$u['email_new']."', email_new='0' WHERE Login='$user'"); set_info($lang['change_email_ok'], 'passed'); } set_info($lang['change_email_al'], 'warning'); } else { safe_sql("UPDATE ".$config['db_account'].".account SET sid3='$sid', sid3_time='$time', email_new_status='step-1' WHERE Login='$user'"); load_lang('mail'); $message = $lang['changeemail_message']; $mailheader = "FROM: xxx.pl <no-reply@xxx.pl> \n"; $mailheader .= "MIME-Version: 1.0\n"; $mailheader .= "Content-Type: text/html;\n"; $mailheader .= "\tcharset=\"UTF-8\"\n"; $mailheader .= "Content-Transfer-Encoding: 8bit\n\n"; set_info($lang['change_email_start'], 'passed'); } else { echo' <form method="post" action="'.$config['site_url'].'profile.php?id=changeemail"> <div class="line"> </div> <table width="80%" align="center" cellspacing="0" cellpadding="10"> <tr> <td class="row-question" align="center"> '.$lang['change_email_info2'].' </td> </tr> <tr> <td align="center"> <br> <input type="submit" value="'.$lang['change_email_send2'].'" class="button"> <input type="hidden" name="step1" value="yes"> <input type="hidden" name="step2" value="yes"> </td> </tr> </table> </form> '; } } else { echo' <form method="post" action="'.$config['site_url'].'profile.php?id=changeemail"> <div class="line"> </div> <table width="80%" align="center" cellspacing="0" cellpadding="10"> <tr> <td class="row-question" align="center"> '.$lang['change_email_info'].' </td> </tr> <tr> <td align="center"> <br> <input type="submit" value="'.$lang['change_email_send1'].'" class="button"> <input type="hidden" name="step1" value="yes"> </td> </tr> </table> </form> '; } } } } } ?>