Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> rejestracja - problem
akord3on
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 24.08.2010

Ostrzeżenie: (0%)
-----


Witam,
mam mały problem z rejestracja uzytkowników na stronie,
posiadam mały skrypt na rejestracje, jednakże przy rejestracji, wyświetla błąd,
"Error in signup procedure".

W czym może być problem?
Oto skrypt:
  1. <?php
  2. // include config file
  3. require_once("config.php");
  4. // include files
  5. require_once(INC_ROOT."/dblayer.php");
  6. require_once(INC_ROOT."/system.php");
  7. require_once(INC_ROOT."/users.php");
  8.  
  9. // initialise db access
  10. global $db;
  11. $db = new MySQL();
  12. $db->connect();
  13.  
  14. $showform = false;
  15. $err_msg = '';
  16. $redirect_to = WEB_ROOT.'/home.php';
  17.  
  18. if ( isset($_POST['signup']) ) { // form was submitted and try to signup user
  19. $username = $_POST['username'];
  20. $password = $_POST['password'];
  21. $password2 = $_POST['password2'];
  22. $email = $_POST['email'];
  23.  
  24. if ( $password == $password2 ) {
  25. if ( !user_load('',$username) ) {
  26. if ( user_signup($username, $password, $email) ) {
  27. $showform = false;
  28. user_login($username, $password); // chg this for different authentication method
  29. $u = user_load($username);
  30. // print_r($u);
  31. header("Location: http://" . $_SERVER['HTTP_HOST'] .$redirect_to);
  32. } else {
  33. echo "Error in signup procedure";
  34. }
  35. } else {
  36. $showform = true;
  37. $err_msg = 'Username already exists. Please choose another username';
  38. }
  39. } else {
  40. $showform = true;
  41. $err_msg = 'Both passwords should be identical.';
  42. }
  43. } else { // no form was submitted
  44. $showform = true;
  45. }
  46.  
  47. if ( $showform ) {
  48.  
  49. if ( is_login() ) { // logged in
  50. header("Location: http://" . $_SERVER['HTTP_HOST'] .$redirect_to);
  51. } else { // not yet logged in
  52. $qb_title = 'konto utworzone';
  53. include("inc/header-meta.inc");
  54. include("inc/qb-static-header.inc");
  55. include("inc/grey-header.inc");
  56. include("inc/content-signup.inc");
  57. include("inc/content-footer.inc");
  58. include("inc/grey-footer.inc");
  59. include("inc/qb-static-footer.inc");
  60. }
  61. }
  62. ?>


Pozdrawiam.
Go to the top of the page
+Quote Post

Posty w temacie
- akord3on   rejestracja - problem   11.10.2010, 19:37:01
- - nospor   Metoda user_signup() zwraca ci FALSE   11.10.2010, 19:38:45
|- - akord3on   Cytat(nospor @ 11.10.2010, 20:38:45 )...   11.10.2010, 19:44:01
- - nospor   A niby jak ty zmieniles to? Gdyby ta metoda zwraca...   11.10.2010, 19:47:13
|- - akord3on   Cytat(nospor @ 11.10.2010, 20:47:13 )...   11.10.2010, 19:53:42
- - nospor   A niby skąd mam wiedziec? Nie mam zielonego pojęci...   11.10.2010, 19:55:10
|- - akord3on   Cytat(nospor @ 11.10.2010, 20:55:10 )...   11.10.2010, 19:59:43
- - nospor   Ty się głupio nie pytać, ty pokazać   11.10.2010, 20:05:03
|- - akord3on   Cytat(nospor @ 11.10.2010, 21:05:03 )...   11.10.2010, 20:09:15
- - nospor   Masz tam mase return. Postaw przed każdym echo ...   11.10.2010, 20:11:54
|- - akord3on   Cytat(nospor @ 11.10.2010, 21:11:54 )...   11.10.2010, 20:26:55
- - nospor   Pokaz jak wstawiles bo zrobiles to źle No jak moż...   11.10.2010, 20:30:38
|- - akord3on   Cytat(nospor @ 11.10.2010, 21:30:38 )...   11.10.2010, 20:33:52
- - nospor   rety.... znajdz 10 roznic echo '1'; else ...   11.10.2010, 20:36:18
|- - akord3on   Cytat(nospor @ 11.10.2010, 21:36:18 )...   12.10.2010, 09:56:10
- - nospor   CytatJednak przy echo, wystąpuje nadal problem ...   12.10.2010, 10:28:08
|- - akord3on   Cytat(nospor @ 12.10.2010, 11:28:08 )...   12.10.2010, 10:38:59
- - nospor   CytatJakoby się ona pojawiła, dał bym znać.A to ju...   12.10.2010, 10:44:10
|- - akord3on   Cytat(nospor @ 12.10.2010, 11:44:10 )...   12.10.2010, 11:04:35
- - nospor   if ( !$username || !$email ) { ...   12.10.2010, 11:07:48
|- - akord3on   Tak jest. A teraz jest, "10Error in signup pr...   12.10.2010, 11:20:44
- - nospor   if ( $db->query("INSERT INTO users(us...   12.10.2010, 11:26:17


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 21:24