Hi I have an issue with the desired output of the following code. I need to print You hit T--
message whilst I see the Form 2 is here!
message along with the button.
But now what happens is when I click T--
button the message appears but the Form 2 is here
content with button disappears. I need that message to be on the screen visible whilst the message You hit T--
prints.
can some one pls highlight how to correct this? Many thanks for looking
here goes the code:
<DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="one" style="width:300px; background:gray;">
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<input type="text" name="txt1" id="txt1">
<?php
if(isset($_POST['sendone']))
{echo "<input type='submit' name='sendtwo' id='sendtwo' value='Two'>";}
?>
<input type="submit" name="sendone" id="sendone" value="One">
</form>
</div>
<div id="two" style="width:300px; background:yellow;">
<?php
if(isset($_POST['sendtwo']))
{echo "Form two is here!"; ?>
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<?php echo "<input type='submit' name='sendt' id='sendt' value='T--'>";}
if(isset($_POST['sendt'])) {echo "You hit T--"; return;}
?>
</form>
</div>
</body>
</html>
If i got this right, is basically print that message when you post ether sendtwo or sendt.
if(isset($_POST['sendtwo']) || isset($_POST['sendt']))
{ echo "Form two is here!"; ?> }
Here's an example.