Two or more different "Submit" Buttons in my code calling different or the same websi

I would like to use two or more different “Submit” Buttons in my code calling different or the same websites.

How do I do this?


                            echo '<form  name="form1" action="total_InsertInto.php" method="post">';
			    echo '<center><table><tr><td>, '<input name="Textinsertintocol1" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Textinsertintocol2" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Textinsertintocol3" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Submitinsertinto" type="submit" value= "Insert Into" width="25" />', '</td></tr></table></center></form>';
			   
                            echo '<form  name="form2" action="total_Update.php" method="post">';
			    echo '<center><table><tr><td>, '<input name="Textupdatecol1" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Textupdatecol2" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Textupdatecol3" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Submitupdate1" type="submit" value= "Insert Into" width="25" />', '</td></tr></table></center></form>';

                            echo '<form  name="form3" action="total_Update.php" method="post">';
			    echo '<center><table><tr><td>, '<input name="Text1updatecol1" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Text1updatecol2" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Text1updatecol3" type="text" value= "" width="25" />', '</td>';
			    echo '<td>, '<input name="Submitupdate2" type="submit" value= "Insert Into" width="25" />', '</td></tr></table></center></form>';

If I understand, taking these forms and making it into ONE form with three actions. Different actions same website and page, no problem. Different form URL actions determined by the button pushed, not possible as far as I know. Markup could use a little touch up assuming you need to echo it.

<?php
echo '<form name="form1" action="total_InsertInto.php" method="post">
	<center>
		<table>
			<tr>
				<td width="25%">, <input name="Textinsertintocol1" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Textinsertintocol2" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Textinsertintocol3" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Submitinsertinto" type="submit" value= "Insert Into" /></td>
			</tr>
		</table>
	</center>
</form>

<form name="form2" action="total_Update.php" method="post">
	<center>
		<table>
			<tr>
				<td width="25%">, <input name="Textupdatecol1" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Textupdatecol2" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Textupdatecol3" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Submitupdate1" type="submit" value= "Insert Into" /></td>
			</tr>
		</table>
	</center>
</form>

<form name="form3" action="total_Update.php" method="post">
	<center>
		<table>
			<tr>
				<td width="25%">, <input name="Text1updatecol1" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Text1updatecol2" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Text1updatecol3" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Submitupdate2" type="submit" value= "Insert Into" /></td>
			</tr>
		</table>
	</center>
</form>';
?>

You could determine the action before hand with a separate form.

<?php
$urls = array("total_InsertInto.php","total_Update.php","total_Update2.php");
$cnt =  count($urls);
echo '<form action="" method="post">
	<center>
		<table>
			<tr>
				<th colspan="' . $cnt . '">Post to URL</th>
			</tr>
			<tr>';
			foreach($urls as $url):
				echo '<td><input type="submit" name="url" value="' . $url . '" /></td>';
			endforeach;
				
echo '			</tr>
		</table>
	</center>
</form>';

$action = (isset($_POST['url']) ? $_POST['url'] : '');
				
echo '<form name="form1" action="' . $action . '" method="post">
	<center>
		<table>
			<tr>
				<td width="25%">, <input name="Textcol1" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Textcol2" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Textcol3" type="text" value= "" />', '</td>
				<td width="25%">, <input name="Submit" type="submit" value= "Insert Into" /></td>
			</tr>
		</table>
	</center>
</form>';
?>

You should remove one button from your code.