Help Getting Started With Form PHP Email Code

Help with processing script for a form.

I learn best through examples and I would be very grateful if somebody could help me write a processing script for a form with the following elements, IDs and types. I cannot seem to get started… I taught myself HTML and CSS over the last few weeks but I am struggling to understand how form entries can communicate with the ‘server’ or ‘script’ and what the function of each is; on top of this, PHP language seems very different to HTML and much more confusing! I only require the form to email me the corresponding answers. Thank you.

<input name="postit" id="yourname" type="text" placeholder="Your Name"> <input name="postit" id="yourtel" type="tel" placeholder="Your Telephone No" style="margin-left:-8px"> <input name="postit" id="youremail" type="email" placeholder="Your Email" style="margin-left:-14px"> <input name="graphpaper" id="sector" type="text" placeholder="e.g. Asset Management"> <input name="graphpaper" id="initial" type="text" placeholder="20,000"> <textarea id="interest" placeholder="Please indicate your interest level (including how soon you would like to get started) and enter any specific questions or needs in this space. Finally please click the envelope and I shall contact you within 48 hours."></textarea> <input type="submit" class="envelopebutton">

Designing the layout of the form with different fieldsets and so on took me a long time and so it would be very helpful if you could help me with the final step. If you are interested, the full form code is:

[code]

Personal Details







About You and Your Requirements



What business/sector are you in? &nbsp &nbsp




What value would you initially consider depositing? &nbsp &nbsp &#163 &nbsp







[/code]

Thank you!

Did you go thru the tutorials on this site or other sites? You really didn’t post a question.

First, you should go thru a simple tutorial.
Here is a good one: http://www.w3schools.com/php/php_forms.asp
(W3 Schools have a ton of simple easy to understand tutorials and walk-thrus.)

Now the reason PHP seems harder to learn that HTML or CSS is because it is a programming system.
HTML is for setting up web pages for display only. CSS “styles” the page before the user sees it.
But, PHP is a real programming system. First, you should understand that PHP is an instructional entity.
You create a series of instructions and they are handled on the server before the browser is even aware
of them. So, long before HTML or CSS is sent out, PHP does it’s stuff. So, always remember, that your
HTML/CSS is handled CLIENT-SIDE and all the output from the PHP code is handled SERVER-SIDE. This
makes it secure as you can not see the code inside the browser. (Just the output from the code.)

So, forms are easy. They are stored in the HTML that is on every page in the world. One note on your code is that you have form fields with the same name. Since you need to be able to pull the data out of them based on the field name, they can not be the same. So, if you read the email address in the form of $_POST[“postit”], then that will be the same as “Your Name”. Change them to unique names. Remember, the name= argument is used by PHP as the fieldname. But, the id= is used by javascript and CSS.

Well, that’s a start. Once you get further along, ask your new questions. I think that link will help a lot.

Good luck!

Sponsor our Newsletter | Privacy Policy | Terms of Service