Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

lug-bg: phpBB obrushtenie kum moq SQL baza danni


  • Subject: lug-bg: phpBB obrushtenie kum moq SQL baza danni
  • From: the_rat@xxxxxx (ivan adams)
  • Date: Thu, 8 Aug 2002 15:40:34 +0300 (EEST)



Zdraveite, 
problem mi e sledniq, izkam da napravq v phpBB da moje da se registrirat samo useri, koito sa v oqtata baza s danni, za celta pipnah tuk tam i napravih purvo da minava prez zapitvane na 3-te imena i egn-to (ne e mnogo sigurno no) i sled tova da otide v registraciqta na phpBB-to s user= imeto mu ... 
Problema e che kakto i da probvam sled kato toi si zapishe parolata v negovata baza s danni ne zapisva v moqta ...
shte vi pratq kakvo sum napravil ...
v phpBB/includes/usercp_register.php namerih mestoto kudeto se insertva v negovata baza s danni ...
sled 

 //
 // Get current date
 //
 $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ",

if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['requi
                        {
        $user_actkey = gen_rand_string(true);
        $key_len = 54 - (strlen($server_url));
        $key_len = ( $key_len > 6 ) ? $key_len : 6;
        $user_actkey = substr($user_actkey, 0, $key_len);
 $sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
                        }
                        else
                        {
                                $sql .= "1, '')";
                        }

 if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
                        {
  message_die(GENERAL_ERROR, 'Could not insert data into users table');
                        }
------------- tova dolu e moeto ----------------

  $sql = "UPDATE STUDENTS set pass='$password_confirm' where name='$username'";
                  if ( !($result = $db->sql_query($sql)) )
                                {
                                        message_die(GENERAL_ERROR, '$password_confirm' '$username');
                                }

sled koeto mi registrira usera v phpBB-to a ne v moqta baza s danni i mi dava greshkata - parolata i usera v '' ...
probval sum i s mysql_connect('','','');
mysql_select_db('');
$result=mysql_query("UPDATE STUDENTS set pass='$password_confirm' where name='$username'");
.... no pak ni shto ...
probvah da vidq dali kato pisha '$password' ne mi izkarva $password vmesto ' promenlivata ' ...
ako nqkoi moje da mi pomogne kak da napravq da se zapisva parolata i v moqta baza s danni mnogo shte sum mu blagodaren ...

predvaritelni blagodarnosti 
Ivan Boiadziev

-----------------------------------------------------------------
http://www.novinar.org - Âåñòíèêúò íà áúëãàðñêîòî ñåìåéñòâî!
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.