Elo!
Mam Pytanko, otóż Gdy sprawdzam Sql to rejestracja niewpisuje mi tam nazwy użytkownika i Emaila... Oto Plik Register:
I 2 pytanko, dlaczego niemoge się zalogować, pisze:Kod:<?php include("head.php"); ?> Register to get your Gamers-Fusion account now, and begin the game. Password Sent to E-mail. <?php $nump = mysql_num_rows(mysql_query("select * from players")); print " <b>$nump</b> people already have."; ?> <form method=post action=register.php?action=register> <table> <tr><td>Username:</td><td><input type=text name=user></td></tr> <tr><td>Email:</td><td><input type=text name=email></td></tr> <tr><td>Verify Email:</td><td><input type=text name=vemail></td></tr> <?php print "<tr><td>Referral ID:</td><td><input type=text name=ref readonly value=$ref> <i>If you don't know what this is, leave it blank.</i></td></tr>"; ?> <tr><td colspan=2 align=center><input type=submit value=Register></td></tr> </form> <?php if ($action == register) { if (!$user || !$email || !$vemail ) { print "You must fill out all fields."; include("foot.php"); exit; } $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'")); if ($dupe1 > 0) { print "Someone already has that username."; include("foot.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'")); if ($dupe2 > 0) { print "Someone already has that email."; include("foot.php"); exit; } if ($email != $email) { print "The emails do not match."; include("foot.php"); exit; } $ref = strip_tags($ref); $user = strip_tags($user); $pass = strip_tags($pass); if ($ref) { mysql_query("update players set refs=refs+1 where id=$ref"); } $pass = rand(10000 , 90000); $message = "welcome to $gamename your pass is $pass login now and change it. have fun playing at $gamename. Webmaster"; mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register."); mail("$email", "$gamename", $message, "From: webmaster@{$_SERVER['SERVER_NAME']}\r\n" ."Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" ."X-Mailer: PHP/" . phpversion()) or die("could not send mail"); print "You are now registered to play, $user. Please check your e-mail for your pass and login now."; print "<br><a href=index.php>login</a>"; } ?> <?php include("foot.php"); ?>
Please fill out all fields.
Oto Kod login.php
(Zmieniłem Kod, aby zamiast emaila logowało za pomoca nicku)Kod:<?php if (!$user || !$pass) { include("head.php"); print "Please fill out all fields."; include("foot.php"); exit; } include("head.php"); $logres = mysql_num_rows(mysql_query("select * from players where user='$user' and pass='$pass'")); if ($logres <= 0) { print "Login failed. If you have not already, please signup. Otherwise, check your spelling and login again."; include("foot.php"); exit; } else { session_register("user"); session_register("pass"); print " <br>Welcome back. Please click <a href=updates.php>here</a> to continue.."; } include("foot.php"); ?>



Odpowiedz z cytatem
Zakładki