which one is better to use default magic quotes or custom addlash / stripslash in PHP? I want to use the best. please help me.
neither.
magic quotes are the root of all evil! (in my eyes, even worse than premature xD optimization)
and why do you want to create a user-defined ( add| strip) slash function when you have your own php tags?
add
strip
If you want to avoid the date for a database, use the functions that are specific to the database (for example mysqli_real_escape_string)
mysqli_real_escape_string
. ( ):
/ , htmlspecialchars
htmlspecialchars
URL-, urlencode
urlencode
. . (. http://xkcd.com/163/)
! PHP 5, PHP 6. , ! , . , ( Python).
, . , - . - , . .
, HTML, htmlspecialchars() . SQL , , , mysql_real_escape_string(). XML, XML- PHP; .
. , .
. script :
set_magic_quotes_runtime(0);
, PHP, PHP, , , .
, - , , PHP PHP, .
, .
Source: https://habr.com/ru/post/1717253/More articles:Is there a free, preferred, standalone clone of the open source Activestate Komodo Rx Toolkit clone? - regexHow to determine session timeouts when using cookieless sessions - asp.netMagento defines a custom CMS page in cms.xml - xmlIPhone user control using a subclass of UIViewController - iphoneСбой хранимой процедуры SQL Server? - sql-serverCase-sensitive variable names in SQL Server? - sqlЗарегистрировано Ajax Enabled.NET Server Control - .netLinux-Embedded (ARM) low memory bandwidth - linuxHow to draw text on an image from a UITextView consists of several lines of a line? - iphoneHow to write a script in ssh to a computer from a remote computer? - scriptingAll Articles