Witam,
Mam problem otóż gdy wypełnię formularz nic się nie dzieje nie wiem dlaczego, gdy kliknę rejestruj strona się odświeża i jest pokazany od nowa formularz. Użytkownika nie dodaje do bazy danych
Plik signup.php:
<?php
include ("appearance/header.php");
include ("modules/signup.functions.php");
include ("include/ff.settings.php");
if (isset($_POST['signup'])) { $do = new_signup
(); }
?>
<?php if (!$_GET['do']) { ?>
<form action="signup.php" method="post" id="regformstep1">
<ol>
<li>
<label>Imię: <span class="red">*</span></label>
<input type="text" id="imie" name="firstname" class="text" />
</li>
<li>
<label>Nazwisko: <span class="red">*</span></label>
<input type="text" id="nazwisko" name="lastname" class="text" />
</li>
<li>
<label>Email: <span class="red">*</span></label>
<input type="text" id="email" name="email" class="text" />
</li>
<li>
<label>Powtórz email: <span class="red">*</span></label>
<input type="text" id="pemail" name="confrim_email" class="text" />
</li>
<li>
<label>Hasło: <span style class="red">*</span></label>
<input type="password" id="haslo" name="password" class="text" />
</li>
<li>
<label >Powtórz hasło: <span class="red">*</span></label>
<input type="password" id="phaslo" name="confrim_password" class="text" />
</li>
<br />
<br />
<br />
<br />
<label><img src="security.image.php" width="144" height="30" /></label>
<br />
<br />
<li>
<label>Kod zabezpieczający: <span class="red">*</span></label>
<input name="security" id="security" type="text" class="text" />
</li>
<li>
<label><a href="terms.php?do=terms" class="text_4_css_bold">Akceptuje Zasady!</a></label>
<input type="checkbox" name="terms" /></td>
</li>
<li class="buttons">
<input type="submit" name="signup" id="signup" class="przycisk" value="Zarejestruj Mnie"/>
<div class="clr"></div></li><br />
</ol>
</form>
<?php } else if ($_GET['do'] == 'complete') { ?>
<table width="100%" border="0" cellpadding="4" cellspacing="2" class="text_2_css">
<tr>
<td>Rejestracja Udana!</td>
</tr>
</table>
<?php } ?>
<?php
include ("appearance/footer.php");
?>
plik signup.functions.php:
<?php
function message_status($type, $message) {
if ($type == 'error') {
return '<table width="100%" border="0" class="warning_message">
<tr><td width="1%"><img src="/images/icons/008.GIF" hspace="6" vspace="6" /></td>
<td width="99%">'.$message.'</td></tr></table>';
} else if ($type == 'done') {
return '<table width="100%" border="0" class="complete_message">
<tr><td width="1%"><img src="/images/icons/015.GIF" hspace="6" vspace="6" /></td>
<td width="99%">'.$message.'</td></tr></table>';
}
}
// rejestracja
function new_signup() {
if (isset($_POST['signup'])) {
$email_exists = sql_query("SELECT * FROM users WHERE email = '".$_POST['email']."'");
$ban_exists = sql_query("SELECT * FROM banned WHERE banned_email = '".$_POST['email']."'");
$username = $data['firstname']. " " .$data['lastname'];
} else if (empty($_POST['firstname'])) {
return message_status('error', 'Wypełnij Pole!');
} else if (empty($_POST['lastname'])) {
return message_status('error', 'Wypełnij Pole!');
} else if (empty($_POST['password'])) {
return message_status('error', 'Wypełnij Pole!');
} else if ($_POST['password'] != $_POST['confrim_password']) {
return message_status('error', 'Hasła nie są takie same!');
} else if (empty($_POST['email'])) {
return message_status('error', 'Wypełnij Pole!');
} else if ($_POST['email'] != $_POST['confrim_email']) {
return message_status('error', 'Emaile nie są takie same!');
return message_status('error', 'Email zbanowany!');
return message_status('error', 'Email zajęty!');
} else if (strtoupper($_POST['security']) != $_SESSION['code']) {
return message_status('error', 'Kod bezpieczeństwa jest zły!');
} else if ($_POST['terms'] != 'on'){
return message_status('error', 'Zaakceptuj Zasady!');
} else {
sql_query("INSERT INTO users (username, password, email, firstname, lastname, user_created, user_login) VALUES ('".$username."',
'".md5($_POST['password'])."', '".$_POST['email']."', '".$_POST['firstname']."', '".$_POST['lastname']."', '".time()."', '0')");
include("lang/emails.php");
mail($_POST['email'], $welcome_subject, $welcome_email.$footers, $headers);
header('Location: signup.php?do=complete');
} }
?>