Two Forms on the Same PHP page
Moderator: General Moderators
Two Forms on the Same PHP page
How do you set up form tags for two or more forms on the same php page? How does that affect accessing the $_POST variables?
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
Code: Select all
<form type="post" action="action.php">
<input type=hidden name="Form1" value=1>
// rest of form with inputs etc
<input type="submit">
<form>
<form type="post" action="action.php">
<input type=hidden name="Form2" value=1>
// rest of form with inputs etc.
<input type="submit">
<form>Code: Select all
<?php
if (isset($_POST['Form1']))
{
// Form1 was sumbitted
}
else
{
// Form 2 was submitted
}
?>-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Weird
I got a strange browser phenom yesterday. I have to forms. Neither are named. In IE 5.5 on XP the action of the first form was used as opposed to the second form's action when the submit button for the second form was hit. I didn't have any problems with that on Mozilla with a Mac or Linux platform. Now that's weird. Or does anybody know what happened there?
I've read about this phenomena many moons ago also. I can to the fully recall the complete article about it, but it was while discussing various IE bugs.
I belive it falls under the issue about how good different browsers support the tag-standards. You know, the ever lasting discussion about: as opposed to just to mention a very small example.
Don't take my words on it tho, might be taken out of context somewhere else. But if someone finds a good resource or article on it, do post a link here.
I belive it falls under the issue about how good different browsers support the tag-standards. You know, the ever lasting discussion about:
Code: Select all
<p>text</p>Code: Select all
text<p>Don't take my words on it tho, might be taken out of context somewhere else. But if someone finds a good resource or article on it, do post a link here.
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England