Click here to Skip to main content
15,886,052 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hello, friends! I am a total noob in html, how do I make my form work? Here is the link to the form I am trying to make → FORM

How do I write the script which sends the data from the form to my e-mail? Thanks a lot!

This is the only thing I have so far:

<form>
Contact details:

<input type="text" placeholder="Name">
<input type="text" placeholder="Last name">
<input type="email" placeholder="E-mail">
<input type="text" placeholder="Phone number">

Shipment:

<input type="text" placeholder="Address">
<input type="text" placeholder="City">
<input type="text" placeholder="Region">
<input type="text" placeholder="Country">
<input type="text" placeholder="ZIP code">

<input type="submit" value="Order now">
</form>
Posted
Updated 15-Dec-15 9:26am
v2
Comments
Sergey Alexandrovich Kryukov 15-Dec-15 15:43pm    
Work for what? Do you have proper handling of the HTTP request in PHP already. Frankly, I cannot understand how would it be possible to be a "noob" in HTML and develop PHP handling on the server side. Normally, HTML is the basic thing. So, I'm afraid that HTML answer may not help you, because you need to understand what happens in HTTP request and after it...
—SA

1 solution

Please see my comment to the question. If you need to submit some HTTP request to the server side, I can see the following missing points:

1) Each input element should have the attribute name, the values of this attributes should be unique in the form. 2) the form element should have the attribute method, typically, method="post", 3) the form element should have the attribute action. Its value should be your PHP script which handles the HTTP request.

Please see: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms[^].

See also (you don't have to do it all): https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects[^].

Frankly, if you need to do anything else, not sending HTTP request, you don't really need to use the form. But to use the form and all the request data, you need to handle it all in PHP, which quite easy, but is the whole different story. Please see: http://php.net/manual/en/tutorial.forms.php[^].

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900