<html> <body> <form action="get1.php" method="GET"> name: <input type="text" name="fname"/> <input type="submit" /> </form> <form action="get1.php" method="GET"> name: <input type="text" name="fname1"/> <input type="submit" /> </form> <?php $f=$_GET["fname"]; $f1=$_GET["fname1"]; echo $f.$f1; ?> WHY CAN'T I PRINT BOTH VALUES? GIVE ME A SOLUTION. </body> </html>
Why don't you use one form with two different submit buttons <form action="get1.php" method="GET"> name: <input type="text" name="fname"/> name: <input type="text" name="fname1"/> <button name="subject" type="submit" value="submit1">submit1</button> <button name="subject" type="submit" value="submit2">submit2</button> </form> HTML: