/    Sign up×
Community /Pin to ProfileBookmark

need help getting html contact form with multipart/form-data to work with php

Hello –

I’m not a developer. I modified a template to build a site, and need help getting the contact form, which has multipart/form-data, to work with a php processing script.

Here’s the relevant script:
<h3 class=”p2″>Contact Form</h3>
<form id=”contact-form” form name =”contact” method=”post”
enctype=”multipart/form-data” action=”sendform.php”>
<fieldset>
<label><span class=”text-form”>Name:</span>
<input name=”p1″ type=”text”></label>
<label><span class=”text-form”>Email:</span>
<input name=”p2″ type=”text”></label>
<label><span class=”text-form”>Phone:</span>
<input name=”p3″ type=”text”></label>
<div class=”wrapper”>
<div class=”text-form”>Message:</div>
<textarea></textarea>
</div>
<div class=”buttons”>
<a class=”button” type=”send” value=”Send”>Send</a>
</div>
</fieldset>
</form>

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NoEffinWayFeb 03.2014 — All the things in the "name" attribute are passed in the $_POST array.

Now, looking at your code, yours may be done via AJAX, because as-is, your <textarea> will not be sent and that send button is an anchor, not a button.

Assuming you posted that, and it is a normal post form, the server would get something like:
<i>
</i>$_POST['p1'];
$_POST['p2'];
$_POST['p3'];
Copy linkTweet thisAlerts:
@vtwauthorFeb 03.2014 — All the things in the "name" attribute are passed in the $_POST array.

Now, looking at your code, yours may be done via AJAX, because as-is, your <textarea> will not be sent and that send button is an anchor, not a button.

Assuming you posted that, and it is a normal post form, the server would get something like:
<i>
</i>$_POST['p1'];
$_POST['p2'];
$_POST['p3'];
[/QUOTE]



NoEffinWay (Like the name) - thanks, makes sense from what I've seen of scripts, and is getting me in the right direction. Was of the same opinion that <textarea> wouldn't be sent, because it doesn't have a name value, like the other fields do. I thought of putting in a name value, but (again, not a coder) didn't get anything that didn't show up on the page.

If AJAX, what then?
Copy linkTweet thisAlerts:
@NoEffinWayFeb 04.2014 — I would need to see the javascript files to help with that. If you want, send me a PM and I'll work with you on it. Or you can paste the JS here, either way.
Copy linkTweet thisAlerts:
@winthropiteFeb 04.2014 — Don't know if it'll help but I used a workaround for passing data to and from a textarea box. Check out my post here.
×

Success!

Help @vtw 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.18,
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,
)...