First this is the code u informed in the HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="this.php" method="post">
<input type="text" name="txt" value="" />
<input type="submit" value="submit" />
</form></body>
</html>
This is the php Code of this.php
if(isset($_POST['txt'])) { ?>
<html>
<body>
Your message has been sucessfully submitted Thanks.
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="this.php" method="post">
<input type="text" name="txt" value="" />
<input type="submit" value="submit" />
</form></body>
</html>
Explain
The
if(isset($_POST['txt']))
checks whether the txt is submitted if yes then show the block inside the if statement else shows the else statement
This was just a simple explanaion!!