Why is the below code displaying the php code from msg.php?
$flag = file('msg.php');
$content = "";
foreach ($flag as $value) {
$content .= $value;
}
echo $content;
Is there a way I can stop it displaying the PHP code?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re outputting it as text with
echoand reading it withfile, neither of which will execute any PHP. Your example can be replaced with:and everything will work properly.