<html> <head> <meta http-equiv="Content-Language" content="en-us"> <title>Untitled 1</title> </head> <body> <form method="post" action="a.php"> <input name="Button1" type="button" value="button1" /><input name="Text1" type="text"></form> <p><input name="Button2" type="button" value="button2" /><input name="Text2" type="text"></p> </body> </html> <?php $id=20; ?> //../a.php?id=20
<?php$id = 20;?><html><head><meta http-equiv="Content-Language" content="en-us"><title>Untitled 1</title></head><body><form method="post" action="a.php"><input type="hidden" name="id" value="<?php echo $id; ?>"><input name="Button1" type="submit" value="button1" /><input name="Text1" type="text"><p><input name="Button2" type="submit" value="button2" /><input name="Text2" type="text"></p></form></body></html>
<?phpecho $_POST["id"]."<br />";if(!empty($_POST["Button1"])){ echo $_POST["Text1"]."<br />"; }if(!empty($_POST["Button2"])){ echo $_POST["Text2"]."<br />"; }?>
<form action='button1.php' method='post'><input type='submit' value='Button 1'><input type='hidden' value='20' name='id20' /></form> <form action='button2.php' method='post'><input type='submit' value='Button 2'><input type='hidden' value='20' name='id40' /></form>
//Get Post Variables$button1 = $_POST['id20'];$button2 = $_POST['id40'];echo $button1;echo $button2;