Author Topic: register problem  (Read 842 times)

0 Members and 1 Guest are viewing this topic.

Offline svarog

  • phpd Basic Member
  • **
  • Posts: 30
  • Karma: 0
    • View Profile
register problem
« on: March 05, 2010, 10:42:35 AM »
when me or any of my user click on register, the message "Sorry, you have provided an invalid security code"  always show, even if they did not write one at all. :-\

Sorry for my english. 

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: register problem
« Reply #1 on: March 05, 2010, 07:55:10 PM »
Yah, that's a bug.

The registration still works thought.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: register problem
« Reply #2 on: March 06, 2010, 04:05:42 AM »
try this replace your register.php with this

Code: [Select]

<?php
/*
+ ----------------------------------------------------------------------------+
|     PHPDirector.
|      $License: GNU General Public License
|      $Website: phpdirector.co.uk
+----------------------------------------------------------------------------+
*/
require('header.php');

 
session_start();
   if((
$_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
      
// Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
      
unset($_SESSION['security_code']);

}
include 
'db.php';
if(isset(
$_COOKIE["id"]))
{
     
header("Location: index.php");
}
else
{
     if(
$_POST["BT_Envoyer"])
     {
          
          
// Vérification de la validité des champs
          
if(!ereg("^[A-Za-z0-9_]{4,20}$"$_POST["TB_Nom_Utilisateur"]))
          {
               
$message "You login must be longer than 4 and less than 20 character<br />\n";
          
          }
          elseif(!
ereg("^[A-Za-z0-9]{4,}$"$_POST["TB_Mot_de_Passe"]))
          {
               
$message "Your password must be longer than 4 character";
          }
          elseif(
$_POST["TB_Mot_de_Passe"] != $_POST["TB_Confirmation_Mot_de_Passe"])
          {
               
$message "Password don't match";
          }
          elseif(!
ereg("^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$",
               
$_POST["TB_Adresse_Email"]))
          {
               
$message "Your E-mail is not valid";
         
 
     }


else
          {

               
$result mysql_query("
                    SELECT user
                         , email
                    FROM pp_user
                    WHERE user = '" 
$_POST["TB_Nom_Utilisateur"] . "'
                    OR email = '" 
$_POST["TB_Adresse_Email"] . "'
               "
);
               
               
// Si une erreur survient
               
if(!$result)
               {
                    
$message "Internal error";
               }
               else
               {
                    
                    
// Si un enregistrement est trouvé
                    
if(mysql_num_rows($result) > 0)
                    {
                         
                         while(
$row mysql_fetch_array($result))
                         {
                              
                              if(
$_POST["TB_Nom_Utilisateur"] == $row["Nom_Utilisateur"])
                              {
                                   
$message "" $_POST["TB_Nom_Utilisateur"];
                                   
$message .= "os already used";
                              }
                              elseif(
$_POST["TB_Adresse_Email"] == $row["email"])
                              {
                                   
$message "This E-mail : " $_POST["TB_Adresse_Email"];
                                   
$message .= "is already used";
                              }
                              
                         }
                         
                    }
          
      
// Insert your code for showing an error message here
     
if(($_SESSION['security_code'] != $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
      
// Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
      
unset($_SESSION['security_code']);

 
$message "Sorry, you have provided an invalid security code";   

}    


else
                    {
                         
                         
                         
// Création du compte utilisateur
                         
$result mysql_query("
                              INSERT INTO pp_user(user,pass,email,register)
                              VALUES('
$_POST[TB_Nom_Utilisateur]','".md5($_POST['TB_Mot_de_Passe'])."','$_POST[TB_Adresse_Email]',CURRENT_DATE())
                         "
);
                         
                         
// Si une erreur survient
                         
if(!$result)
                         {
                              
$message "An internal error has occured";
                         }
                         else
                         {
                                   
                                   
// Message de confirmation
                                   
$message "Congratulations ".$_POST['TB_Nom_Utilisateur'].", your account has been created, you can now start to play<br />\n";
                                   

                                   
                              }
                              
                         
}
                         
                    }
                    
               }
               
          }
          
    
 }
  


$smarty->assign('message'$message);         
$smarty->display('register.tpl');
   


?>

« Last Edit: March 06, 2010, 04:10:07 AM by winracer »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline svarog

  • phpd Basic Member
  • **
  • Posts: 30
  • Karma: 0
    • View Profile
Re: register problem
« Reply #3 on: March 06, 2010, 02:53:57 PM »
It's ok now. Thanks :)

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: register problem
« Reply #4 on: March 07, 2010, 10:53:58 PM »
It's ok now. Thanks :)

you are welcome, if you see anything else please post.
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline kirula

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
    • View Profile
Re: register problem
« Reply #5 on: March 09, 2010, 07:06:31 AM »
Security Code  not  view  Pl  help


http://kirula.info/videos2/register.php

Offline svarog

  • phpd Basic Member
  • **
  • Posts: 30
  • Karma: 0
    • View Profile
Re: register problem
« Reply #6 on: March 09, 2010, 02:19:59 PM »
upload gen.php again or check if it's in folder videos2

Offline kirula

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
    • View Profile
Re: register problem
« Reply #7 on: March 10, 2010, 03:54:48 AM »
I reuplord  but  still  not  working  Pl  help

Offline svarog

  • phpd Basic Member
  • **
  • Posts: 30
  • Karma: 0
    • View Profile
Re: register problem
« Reply #8 on: March 10, 2010, 07:12:47 AM »
Also check  monofont.ttf  - is it uploaded in videos2