Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> problem zwiazany z literkami
Azz
post 21.01.2006, 12:04:24
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
SongoQ
post 21.01.2006, 12:07:16
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


http://pl2.php.net/manual/pl/function.strtolower.php


--------------------
Go to the top of the page
+Quote Post
Azz
post 21.01.2006, 12:17:39
Post #3





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

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


domyslilem sie jednak gdy wpisze lOl wtedy to zawodzi smile.gif
Go to the top of the page
+Quote Post
SongoQ
post 21.01.2006, 12:19:26
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


Cos z tymi Twoimi domyslami nie tak.

  1. <?php
  2. if(strtolower($ibforums->input['username']) == strtolower($ibforums->member['name']))
  3. ?>


--------------------
Go to the top of the page
+Quote Post
Azz
post 21.01.2006, 12:21:49
Post #5





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

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


działa nie zauważyłem stringa przed input smile.gif

Ten post edytował Azz 21.01.2006, 12:24:32
Go to the top of the page
+Quote Post
SongoQ
post 21.01.2006, 12:25:08
Post #6





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


A echo strtolower($ibforums->input['username']) i echo strtolower($ibforums->member['name']) daja te same stringi?


--------------------
Go to the top of the page
+Quote Post
Azz
post 21.01.2006, 12:27:54
Post #7





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
SongoQ
post 21.01.2006, 12:29:49
Post #8





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


Sprawdz to co Ci podalem wczesniej.


--------------------
Go to the top of the page
+Quote Post
Azz
post 21.01.2006, 12:54:49
Post #9





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

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


to samo
Go to the top of the page
+Quote Post
SongoQ
post 21.01.2006, 16:31:02
Post #10





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


Ale co to samo stringi sa takie same?


--------------------
Go to the top of the page
+Quote Post
Azz
post 21.01.2006, 19:20:05
Post #11





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

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


wsztstko chodzi tak jak powinno smile.gif
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 27.06.2025 - 06:32