well this part isn't a security risk part, so you can leave your code or change it, no problem...
intval is more secure, because strings are always converted into an int value. that'll take effect on inputboxes whenever a user should enter an intval but enters a string this could produce security problems as i can think of.
hmm, is this understandable?
perhaps an example:
PHP Code:
$posts="5, password=MD5('hello')";
$DB-site->query("UPDATE user SET posts=$posts");
as you can see this would run this query:
UPDATE user SET posts=5,password=MD5('hello')
if you use intval this cannot happen:
PHP Code:
$posts="5, password=MD5('hello')";
$DB-site->query("UPDATE user SET posts=".intval($posts));
this would just run this query (as normally wanted):
UPDATE user SET posts=5