|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a simple MySQL & PHP3 guestbook. It works fine, but there are problems if a user add text containing ` or / or " or { or ] or + or ) Is there a universal method that allows save & secure data input of any symbols into MySQL/PHP3 guestbook and then display them correctly? Thanks in advance. Roman |
|
#2
|
||||
|
||||
|
From the PHP manual:
string addslashes(string str); Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash () and NUL (the null byte). string rawurlencode(string str); Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits. This is the encoding described in RFC1738 for protecting literal characters from being interpreted as special URL delimiters, and for protecting URL's from being mangled by transmission media with character conversions (like some email systems). For example, if you want to include a password in an ftp url: Each of these has a function that converts that data back to the original, also. Hope this helps. ---John Holmes ---www.SepodatiCreations.com |
|
#3
|
|||
|
|||
|
Dear John,
Thank You for Your help. Roman <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by SepodatiCreations: From the PHP manual: string addslashes(string str); Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash () and NUL (the null byte). string rawurlencode(string str); Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits. This is the encoding described in RFC1738 for protecting literal characters from being interpreted as special URL delimiters, and for protecting URL's from being mangled by transmission media with character conversions (like some email systems). For example, if you want to include a password in an ftp url: Each of these has a function that converts that data back to the original, also. Hope this helps. ---John Holmes ---www.SepodatiCreations.com [/quote] |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > save & secure MySQL/PHP3 data manipulation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|