194 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+3 more
ArashFarivar says
But if the ‘catgid’ is not number, then it’s an error and we should stop…
If we for example convert “q” into an int, it will be 0 and then we check for 0 value? or put it into the sql query?
I think this code will fix this problem simply: if(!is_numeric($_GET[‘catgid’])) die();
14 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 50+ items on Envato Market
ameero says

 $id = (int)$_GET['catgid'];
or

$id = intval($_GET['catgid']);
will turn the catgid into an integer if possible

“hallo” -> 0
“2’ and true” -> 2
” 123bla” -> 123
2 -> 2
b2 -> 0
2.5 -> 2

hmm where do i add the line exactally ? after the query or before the sql query ?

14 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 50+ items on Envato Market
ameero says

But if the ‘catgid’ is not number, then it’s an error and we should stop…
If we for example convert “q” into an int, it will be 0 and then we check for 0 value? or put it into the sql query?
I think this code will fix this problem simply: if(!is_numeric($_GET[‘catgid’])) die();

that actually made the page blank nothing at all appeard when enter number or letter or anuthing on url.

194 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+3 more
ArashFarivar says


But if the ‘catgid’ is not number, then it’s an error and we should stop…
If we for example convert “q” into an int, it will be 0 and then we check for 0 value? or put it into the sql query?
I think this code will fix this problem simply: if(!is_numeric($_GET[‘catgid’])) die();
that actually made the page blank nothing at all appeard when enter number or letter or anuthing on url.

Well, I thought this page always gets the ‘catgid’ and shows this category’s data. But if you want to show the page when there is no ‘catgid’ set, yes this will show it blank. I don’t know how the page is :)

14 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 50+ items on Envato Market
ameero says



But if the ‘catgid’ is not number, then it’s an error and we should stop…
If we for example convert “q” into an int, it will be 0 and then we check for 0 value? or put it into the sql query?
I think this code will fix this problem simply: if(!is_numeric($_GET[‘catgid’])) die();
that actually made the page blank nothing at all appeard when enter number or letter or anuthing on url.
Well, I thought this page always gets the ‘catgid’ and shows this category’s data. But if you want to show the page when there is no ‘catgid’ set, yes this will show it blank. I don’t know how the page is :)

you dont undrestand me :)

there is catagories displayed and then when user clicks the catagory the catgId comes into places

so catg.php will show all available catagories then catg.php?catgId=1 will show all groups inside catagory 1

this how it works .

btw : what is $id in this ? $id = intval($_GET[‘catgid’]);

$id is not read at all in the process what is it ?

294 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
BizLogic says


$id = (int)$_GET['catgid'];
im really not good at php can you explain this :) ?

If the supplied argument is not an integer it will be converted to zero.
Problem solved.

14 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 50+ items on Envato Market
ameero says



$id = (int)$_GET['catgid'];
im really not good at php can you explain this :) ?
If the supplied argument is not an integer it will be converted to zero.
Problem solved.

what is $id ? I mean I added this under the SQL query and nothing changed

294 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
BizLogic says

Post the code from your file

14 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 50+ items on Envato Market
ameero says

Post the code from your file

i emailed you the whole page :)

294 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
BizLogic says

That’s almost the worst code I’ve ever seen.

Change this:
if(isset($catgId)){ global $mysqli; $var=array_filter(preg_split("/\D+/", $catgId)); $cI=reset($var); $sql="select * from groups where catgId =".mysql_real_escape_string($cI)." order by size desc";

To this:
if(isset($catgId)){ global $mysqli; $cI = (int)$catgId; $sql="select * from groups where catgId =".mysql_real_escape_string($cI)." order by size desc";

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by