Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem zwiazany z literkami
Azz
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 28.07.2005

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


Witam

Jak zrobić aby skrypt uwazał ze male i duże litery to to samo

do skryptu dopisałem linike

Kod
if($ibforums->input['username'] == $ibforums->member['name']) $this->error("donate_self");


gdzie name np. LoL i jak w formularzu wpisze LoL wszystko działa
jednak gdy wpisze lol nie działa ;/

Pozdrawiam

Ten post edytował Azz 21.01.2006, 12:04:39
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Azz
post
Post #2





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 28.07.2005

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


jest to fragmen skryptu ibstore

Kod
  function donatemoney() {
     global $ibforums, $DB, $std, $print, $ibstore;
    $this->nav        = array( $ibforums->lang['money_var'] );
     if($ibforums->member['g_donate_points'] == 0) $this->error("no_permissions");
     $ibforums->lang['donate_to'] = str_replace("<CURRENCY>", $ibforums->vars['currency_name'], $ibforums->lang['donate_to']);
     if($ibforums->member['points'] <= 0) $disabled = "disabled";
     $this->output    .=    $this->html->donatemoney($disabled);
  }
  function dodonate_money() {
     global $DB,$ibforums,$ibstore;
     if($_POST['amount'] == "" || $ibforums->input['username'] == "") $this->error("donate_cheating");

     $ibforums->input['username'] = trim($ibforums->input['username']);
     $ibforums->input['amount']  = $ibforums->input['amount'];

     if($ibforums->input['username'] == "") $this->error("donate_empty");
     if($ibforums->input['amount'] <= 0) $this->error("donate_notenought");
     if(strtolower($ibforums->input['username']) == strtolower($ibforums->member['name'])) $this->error("donate_self");
     if($ibforums->member['points'] < $ibforums->input['amount']) {
    $this->error("donate_notenought");

     }
     $reciever = $this->get_memberid($ibforums->input['username'],',points');
     $reciever['points'] += $ibforums->input['amount'];
     $ibforums->member['points'] -= $ibforums->input['amount'];
     $DB->query("UPDATE _ipb_members SET points={$reciever['points']} WHERE id={$reciever['id']} LIMIT 1");
     $DB->query("UPDATE _ipb_members SET points={$ibforums->member['points']} WHERE id={$ibforums->member['id']} LIMIT 1");
     $message = str_replace("{to}"    ,$reciever['name']     ,$ibforums->vars['money_donation']);
     $message = str_replace("{from}"    ,$ibforums->member['name']   ,$message);
     $message = str_replace("{amount}"      ,$ibforums->input['amount']   ,$message);
     $message = str_replace("{message}"      ,$ibforums->input['message']  ,$message);
     $message = str_replace("{currency_name}"    ,$ibforums->vars['currency_name'],$message);
     $message = str_replace("\n"        ,"<br />"       ,$message);
     $message = preg_replace("#{date: (.+?)}#ies",'date("\\1",time());'    ,$message);
     $ibstore->sendpm($reciever['id'],$message,$ibforums->lang['sent_money']);
     $ibstore->write_log("Donation of {$ibforums->input['amount']} sent to {$reciever['name']}.","donate_m");
     $ibstore->redirect("donated","act=store");    
  }


dodałem
Kod
if(strtolower($ibforums->input['username']) == strtolower($ibforums->member['name'])) $this->error("donate_self");

aby nie można było przesyłać punktów do siebie i wszystko chodzi tak jak powinno

Ten post edytował Azz 21.01.2006, 12:28:13
Go to the top of the page
+Quote Post

Posty w temacie
- Azz   problem zwiazany z literkami   21.01.2006, 12:04:24
- - SongoQ   http://pl2.php.net/manual/pl/function.strtolower.p...   21.01.2006, 12:07:16
- - Azz   domyslilem sie jednak gdy wpisze lOl wtedy to zawo...   21.01.2006, 12:17:39
- - SongoQ   Cos z tymi Twoimi domyslami nie tak. [PHP] pobier...   21.01.2006, 12:19:26
- - Azz   działa nie zauważyłem stringa przed input   21.01.2006, 12:21:49
- - SongoQ   A echo strtolower($ibforums->input['us...   21.01.2006, 12:25:08
- - Azz   jest to fragmen skryptu ibstore Kod function don...   21.01.2006, 12:27:54
- - SongoQ   Sprawdz to co Ci podalem wczesniej.   21.01.2006, 12:29:49
- - Azz   to samo   21.01.2006, 12:54:49
- - SongoQ   Ale co to samo stringi sa takie same?   21.01.2006, 16:31:02
- - Azz   wsztstko chodzi tak jak powinno   21.01.2006, 19:20:05


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: 4.10.2025 - 18:00