Jump to content
MakeWebGames

whats the best way to secure your header?


JAMESOMIGHTY

Recommended Posts

this is what i have

 

<?php
$count = 3;
$x = -1;
while($x < $count)
{
$places_to_be_secured = array("ID","viewforum","viewtopic");
$x++;
$_GET[$places_to_be_secured[$x]] = abs(@intval($_GET[$places_to_be_secured[$x]]));
$_GET['ID'] = abs(@intval($_GET['ID']));
$_GET['viewforum'] = abs(@intval($_GET['viewforum']));
$_GET['viewtopic'] = abs(@intval($_GET['viewtopic']));
$_GET['reply'] = abs(@intval($_GET['reply']));
}
Link to comment
Share on other sites

$places_to_be_secured = array('ID', 'viewforum', 'viewtopic', 'reply');
$limit = count($places_to_be_secured);
for ($x = 0; $x < $limit; $x++)
{
   $_GET[$places_to_be_secured[$x]] = abs(@intval($_GET[$places_to_be_secured[$x]]));
}

 

Fixed that for you.

I can't comment on how secure it is. As far as I can tell, it's only useful if you need these fields to be positive integers.

Link to comment
Share on other sites

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...