Jump to content

form name variable?


sunfire

Recommended Posts

Hello,

I'm really new to php, I have been asked to learn it I have done most of my work in Coldfusion. I have been searching on how to get the name of a form tag in php. In this example it would be "UpdateList". I looped through the $_POST but did not see it.

 

<form name="UpdateList" action="index.php" method="post">

 

What am I missing?

 

Thanks,

tom

Link to comment
https://forums.phpfreaks.com/topic/104387-form-name-variable/
Share on other sites

Use a differently named submit button.

 

//form1
<input type="submit" value="submit_button_1" />

//form2
<input type="submit" value="submit_button_2" />

 

Then use:

<?php
if ($_POST['submit_button_1'])
       {
              // etc
       }
if ($_POST['submit_button_2'])
       {
              // etc
       }
?>

Link to comment
https://forums.phpfreaks.com/topic/104387-form-name-variable/#findComment-534435
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.