Jump to content
MakeWebGames

Recommended Posts

Posted

Sooo now you're letting users can enter integers & characters into your form, well I hope atleast you're attempting to secure the query.

ctype_digit(), only allows digits, so I'm not sure what you're doing wrong. ?(

Posted

I'm not 100% sure either

Originally to test I told him to use $_POST['blah'] = abs((int) $_POST['blah'])

but with simple -999999999999999 or +99999999999999999999- was slipping through so i dno.

Posted

$_POST['blah'] = abs((int) $_POST['blah']), would work, as long as it goes into the DB as that, it's fine.

Anyway what I forgot to mention was on some server setups, for some reason ctype_digit() allows the '-' character. -- I've had first hand experience with this.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...