Yeah, its it possible to have multiple form in a single page.
for example:
<form action=test.php method=post>
---
--
</form>
<form action=test.php method=post>
---
---
</form>
Both the form action is the same test.php. Any problem ?
Yeah, its it possible to have multiple form in a single page.
for example:
<form action=test.php method=post>
---
--
</form>
<form action=test.php method=post>
---
---
</form>
Both the form action is the same test.php. Any problem ?
Jump to PostThis is usually done by giving each submit button a unique id/name:
<input id="sub1" name="sub1" type="submit" value="Submit Form 1" />
it's a rubbish name/id, I know, but you get the idea. Then in your form handling routine:
if(isset($_POST['sub1'])){ //code for handling this form }
You can have multiple forms on a page and they can both go to the same page. You will need to identify which form has been submitted to test.php.
hi,
how to identify this? which form is submitted to test.php ? can you help me out. How to identity, which form been submitted to test.php?
This is usually done by giving each submit button a unique id/name:
<input id="sub1" name="sub1" type="submit" value="Submit Form 1" />
it's a rubbish name/id, I know, but you get the idea. Then in your form handling routine:
if(isset($_POST['sub1'])){
//code for handling this form
}
In addition, you can use an if code before the <head> to establish different handlings for each form.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.
You're trying to visit a URL that doesn't currently exist on the web. Most likely, a member posted a link a long time ago to a web page that has since been removed. It's also possible that there was a typo when posting the URL. We redirect you to this notice instead of stripping out the link to preserve the integrity of the post.