/    Sign up×
Community /Pin to ProfileBookmark

Multiple form help

Greetings. I am attempting to implement four forms on a single page, but each time any of the forms is submitted, the form is sent four times (once for each form). How can I make it where only the desired form is submitted?

I am using php includes to use the form in the html:

[B]<?php include (‘_inc/contact-form1.php’); ?>[/B]

[B]<?php include (‘_inc/contact-form2.php’); ?>[/B]

[B]<?php include (‘_inc/contact-form3.php’); ?>[/B]

[B]<?php include (‘_inc/contact-form4.php’); ?>[/B]

Each form has a separate email address set up as the recipient, but each time any of the forms is submitted, it is sent to all four recipients. I assume this has to do with they way I am submitting the forms.

Here is my opening form line:

[B]<form id=”contact-form1″ action=”<?php echo $_SERVER[“PHP_SELF”]?>” method=”post”>[/B]

Any help would be appreciated. Also let me know what more info would be needed to answer this. I know I haven’t supplied much because I am hoping it is an easy answer.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ShbenauthorMar 02.2012 — each form has a unique opening form line:

[B]<form id="contact-form1" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">[/B]

...

[B]<form id="contact-form2" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">[/B]

...

[B]<form id="contact-form3" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">[/B]

...

[B]<form id="contact-form4" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">[/B]
×

Success!

Help @Shben spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...