Based on my observations, it appears that when you use the include function to try to use content from another file and then press the submit button, that file is displayed. Here's an example:
I have a file called File1, whose contents are below...
<?php
$submitClicked = false;
if(isset($_POST['submit']))
{
$submitClicked = true;
}
And now I want to use another file to make output appear on the screen if I click the submit button. I do this with a main file that has html in it:
<!Doctype html>
Practice
<body>
<form action = "File1.php" method = "POST">
<?php
include_once 'File1.php';
if($submitClicked)
{
echo "<h1> <em>Submit Clicked!</em>";
}
else
{
echo "Nope";
}
?>
<input type = "submit" name = "submit">
</input>
</form>
</body>
Now, when I click the submit button the page literally goes blank. I notice that it's going to the file in the include function. Why does it do that and how do I get it to do what I intend for it to (which is to display Submit Clicked) when the submit button is clicked?