MyBB Community Forums
intval($mybb->input['id'] - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: intval($mybb->input['id'] (/thread-172113.html)



intval($mybb->input['id'] - marcus123 - 2015-06-19

I am trying to return the value of the input: test.php?action=read&id=this with intval($mybb->input['id'] but it returns 0 whenever the value is not numeric!

$_GET['id'] does return it but it's not secure! Any ideas????


RE: intval($mybb->input['id'] - Jones H - 2015-06-19

That's exactly what intval is supposed to do...


RE: intval($mybb->input['id'] - Matt - 2015-06-19

http://php.net/intval

"The integer value of var on success, or 0 on failure"


RE: intval($mybb->input['id'] - marcus123 - 2015-06-19

Strange case I use this like this: echo $mybb->input['id']; yet it returns 0 or nothing

My bad it does echo the vale sorry!