Pomoc - Szukaj - U¿ytkownicy - Kalendarz
Pe³na wersja: Gamers-Fusion 2.5
Forum PHP.pl > Forum > PHP
piotrex1995
Mam Gamers-Fusion 2.5.Pozmienia³em odpowiednio pliki config.php i chatmsgs.php.Ale nadal pisze, abym wype³ni³ wszystkie pola.
Fishu
Ale gdzie wype³ni³ wszystkie pola ? podaj kod bo nie orientuje siê.
piotrex1995
plik register.php
  1. <?php include("head.php"); ?>
  2. Jakis teskt, ze bedzie wysylalo na e-mail ;p
  3.  
  4. <?php
  5. $nump = mysql_num_rows(mysql_query("select * from players"));
  6. print " <b>$nump</b> people already have.";
  7. ?>
  8.  
  9.  
  10. <form method=post action=register.php?action=register>
  11. <table>
  12. <tr><td>Username:</td><td><input type=text name=user></td></tr>
  13. <tr><td>Email:</td><td><input type=text name=email></td></tr>
  14. <tr><td>Verify Email:</td><td><input type=text name=vemail></td></tr>
  15. <?php
  16. 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>";
  17. ?>
  18. <tr><td colspan=2 align=center><input type=submit value=Register></td></tr>
  19. </form>
  20.  
  21. <?php
  22. $action =$_GET['action'];
  23. if ($action == 'register') {
  24. if (!$user || !$email || !$vemail ) {
  25. print "You must fill out all fields.";
  26. include("foot.php");
  27. }
  28. $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'"));
  29. if ($dupe1 > 0) {
  30. print "Someone already has that username.";
  31. include("foot.php");
  32. }
  33. $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'"));
  34. if ($dupe2 > 0) {
  35. print "Someone already has that email.";
  36. include("foot.php");
  37. }
  38. if ($email != $email) {
  39. print "The emails do not match.";
  40. include("foot.php");
  41. }
  42. $ref = strip_tags($ref);
  43. $user = strip_tags($user);
  44. $pass = strip_tags($pass);
  45. if ($ref) {
  46. mysql_query("update players set refs=refs+1 where id=$ref");
  47. }
  48. $pass = rand(10000 , 90000);
  49. $message = "welcome to $gamename your pass is $pass login now and change it. have fun p
    laying at $gamename. Webmaster"
    ;
  50. mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register.");
  51. mail("$email", "$gamename", $message,
  52.  "From: webmaster@{$_SERVER['SERVER_NAME']}r\n"
  53. ."Reply-To: webmaster@{$_SERVER['SERVER_NAME']}r\n"
  54. ."X-Mailer: PHP/" . phpversion()) or die("could not send mail");
  55.  
  56. print "You are now registered to play, $user. Please check your e-mail for your pass and login now.";
  57. print "<br><a herf=index.php>login</a>";
  58. }
  59. ?>
  60.  
  61. <?php include("foot.php"); ?>
Fishu
je¿eli masz wy³±czone register_globals zamieñ te zmienne $user, $email i $vemail na $_POST['user'], $_POST['email'] i $_POST['vemail'] albo nie wiem czemu tongue.gif
piotrex1995
Nie dzia³a, mo¿e przerób ten kod i go podasz haha.gif (Wiem jak to brzmi haha.gif)
To jest wersja lo-fi g³ównej zawarto¶ci. Aby zobaczyæ pe³n± wersjê z wiêksz± zawarto¶ci±, obrazkami i formatowaniem proszê kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.