I've got a little script on my site where it will display an included article from a variable passed from the url, but I can't get it working properly. Here's the code:
So the page url will be something like foo.php?article=2
But I don't want it to include if the article= something other than a valid number or a string of text etc. Any help appreciated
Code:
if ($article <= 6 || is_int($article)) {
$displayArticle = 'article' . $article . '.inc.htm';
} else {
$displayArticle = 'article.inc.htm';
}
So the page url will be something like foo.php?article=2
But I don't want it to include if the article= something other than a valid number or a string of text etc. Any help appreciated
