$article_id=$_GET['article_id']; // Collecting data from query string
if(!is_numeric($article_id)){ // Checking data it is a number or not
echo "Data Error";
exit;
}
Since you are including a variable within the string you will need to either use double quotes, or break out of the single quotes otherwise the variable will just be treated as a string.
I went DUH for a minute. It was in a function so I had to do this
public function logged_in_protect() {
if ($this->logged_in() === true) {
$article_id=$_GET['article_id']; // Collecting data from query string
if(!is_numeric($article_id)){ // Checking data it is a number or not
echo "Data Error";
exit;
}
header("Location: home.php?article_id=$article_id");
exit();
}
}