FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Rejecting Certain Non-ASCII Characters
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Rejecting Certain Non-ASCII Characters [message #181173 is a reply to message #181167] Fri, 19 April 2013 22:11 Go to previous messageGo to previous message
Jim Higgins is currently offline  Jim Higgins
Messages: 20
Registered: November 2010
Karma:
Junior Member
On Fri, 19 Apr 2013 21:38:31 +0000, in
<etd3n8paphvs1mp97ts8povdkaecg9u5in(at)4ax(dot)com>, Jim Higgins
<ILikeMy(at)Privacy(dot)bogus> wrote:

> On Fri, 19 Apr 2013 09:30:54 -0700, in
> <2ject.401871$Nq4(dot)359760(at)newsfe21(dot)iad>, Daniel Pitts
> <newsgroup(dot)nospam(at)virtualinfinity(dot)net> wrote:
>
>> On 4/19/13 9:16 AM, Jim Higgins wrote:
>>>
>>> I have a problem with people entering a slashed zero vs a standard
>>> ASCII zero into HTML forms intended to store data in a MySQL database.
>>>
>>> Is there a simple way in PHP to restrict input to the ASCII Character
>>> set, specifically hex 0x20 - 0x7E ? Or a simple way to detect
>>> characters outside this range before committing them to the database?
>>>
>>> My mind says it should be easy to detect and that I should be able to
>>> do it myself, but for some reason I'm drawing a huge blank.
>>>
>>> Thank you.
>>>
>>
>> Are they literally putting "\0", or do you mean it is sending the byte 0
>> (where "0" is the byte 48)?
>>
>> If they are putting "\0", then this indicates you are not escaping the
>> string appropriately. Don't filter it, escape it.
>>
>> If it is the byte 0, then that is a very unusual thing for them to submit.
>
>
> Where I want to see byte 48 (decimal) they are sending the code for a
> zero with a slash thru it. When displaying the data on an HTML page
> it appears as "A~" consisting of 0x41 0x7E hex (65 254 decimal.)


Make that 65 126 decimal.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: googleapi problem
Next Topic: Undefined variable
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 10:20:30 GMT 2024

Total time taken to generate the page: 0.03761 seconds