Two buttons

hello,

i have file index.php


<?php include('a.php');?>
<?php include('b.php');?>

and i have two files a.php and b.php:
file: a.php


<?php echo "file A /n"; ?>
<?php if (isset($_POST['Submit'])){
echo "I pressed A /n";
}?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<input type="Submit" name="Submit" value="A"/></form>

file b.php


<?php echo "file B /n"; ?>
<?php if (isset($_POST['Submit1'])){
echo "I pressed B /n";
}?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<input type="Submit" name="Submit1" value="B"/></form>

I want to ask, when i press Button A it shows me:
file A
I pressed A
file B

But when i press Button B it shows me:
file B
I pressed B

it dont show file A. How can i make to show and file A at the end ?

It does say “file A” no matter which button you click.

//youtu.be/R4NuGPzSRzY

include() is completely equivalent to pasting the contents of the file at that point in the code. The “file A” / “file B” output has nothing to do with having separate files. This is your actual code:

<?php echo "file A /n"; ?>
<?php if (isset($_POST['Submit'])){
echo "I pressed A /n";
}?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<input type="Submit" name="Submit" value="A"/></form>
<?php echo "file B /n"; ?>
<?php if (isset($_POST['Submit1'])){
echo "I pressed B /n";
}?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<input type="Submit" name="Submit1" value="B"/></form>

Also, the escape character is a backslash (\) not forward slash (/).
is the escape sequence for a newline.

Thank you for your answer, but i use include(); because i want to put them into the different places … And when i press for example A button i want to include B file content, and if i press B i want to include A file content.