Jump to content

Problem with ctype_digit


phpnoob80

Recommended Posts

hello, i am trying to use ctype_digit to check that an id passed in url contains only numbers. i had been using this thinking it was correct but then i noticed if i typed something like listid=#4 it would act as if # was numerical.

 

am i doing something wrong or is this a quirk of ctype_digit?

 

here is a typical use of it within my scripts

 

if(ctype_digit($_GET['inviteid']) && ctype_digit($_GET['listid']))

{

//carry on

}

else

{

//echo error

 

thanks

jj

Link to comment
https://forums.phpfreaks.com/topic/43571-problem-with-ctype_digit/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.