Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PDO execute bindowanie
smiady
post
Post #1





Grupa: Zarejestrowani
Postów: 137
Pomógł: 2
Dołączył: 2.07.2007
Skąd: Ostrzeszów

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


Witam.

Czy jak korzysta się z execute() nie trzeba już sprawdzać danych przed sql injection ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
Turson
post
Post #2





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Jak bindujesz to nie
Go to the top of the page
+Quote Post
smiady
post
Post #3





Grupa: Zarejestrowani
Postów: 137
Pomógł: 2
Dołączył: 2.07.2007
Skąd: Ostrzeszów

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


Czyli muszę robić bindValue przed każdym execute ?
Go to the top of the page
+Quote Post
Turson
post
Post #4





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


Nie przed każdym. Jeżeli w zapytaniu występują wrażliwe dane - np. pochodzące od użytkownika (z formularza). Możesz bindParam(), bindValue() albo w execute tablicą bindować. Wszystkie przykłady masz w manualu.
Go to the top of the page
+Quote Post
smiady
post
Post #5





Grupa: Zarejestrowani
Postów: 137
Pomógł: 2
Dołączył: 2.07.2007
Skąd: Ostrzeszów

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


O co chodzi bindowanie tablicą w execute ?
Go to the top of the page
+Quote Post
Turson
post
Post #6





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


http://php.net/manual/en/pdostatement.execute.php
Example #2 i #3
Go to the top of the page
+Quote Post
KsaR
post
Post #7





Grupa: Zarejestrowani
Postów: 520
Pomógł: 102
Dołączył: 15.07.2014
Skąd: NULL

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


Stackoverflow,
SQL Injection (może) być możliwe z kodowaniem "Latin-1",
Cytat
if you:

Use Modern Versions of MySQL (late 5.1, all 5.5, 5.6, etc) AND mysql_set_charset() / $mysqli->set_charset() / PDO's DSN charset parameter (in PHP ≥ 5.3.6)
OR

Don't use a vulnerable character set for connection encoding (you only use utf8 / latin1 / ascii / etc)
You're 100% safe.

Otherwise, you're vulnerable even though you're using mysql_real_escape_string()...
Go to the top of the page
+Quote Post

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: 15.09.2025 - 06:43