Very simple contact form

Here is an example of using PHP with html form data to make a contact form for a web site. This is also a good example of grabbing HTML form data with PHP and using it.  Here is the demo:

 

 

Here is the code:

This is your form. You can add any form tags you like. Change the extension to ‘html’ instead of ‘txt’ if you wanna try it.
form

Here what does the leg work. The main part of this file is the PHP code. For this to work for you, change the extension from ‘txt’ to ‘php’ then change the email address to your email.

email

Leave me any questions if your having trouble with it or want to comment on it.

Update:

I have since updated the contact form to add some extra CSS properties and I have added Google CAPTCHA to prevent spam. Here is the CSS properties I have added to create slightly more attractive design.

:invalid { 
  border-color: #e88;
  -webkit-box-shadow: 0 0 5px rgba(255, 0, 0, .8);
  -moz-box-shadow: 0 0 5px rbba(255, 0, 0, .8);
  -o-box-shadow: 0 0 5px rbba(255, 0, 0, .8);
  -ms-box-shadow: 0 0 5px rbba(255, 0, 0, .8);
  box-shadow:0 0 5px rgba(255, 0, 0, .8);
}

:required {
  border-color: #88a;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 255, .5);
  -moz-box-shadow: 0 0 5px rgba(0, 0, 255, .5);
  -o-box-shadow: 0 0 5px rgba(0, 0, 255, .5);
  -ms-box-shadow: 0 0 5px rgba(0, 0, 255, .5);
  box-shadow: 0 0 5px rgba(0, 0, 255, .5);
}

form {
  width:300px;
  margin: 20px auto;
}

input {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  border:1px solid #ccc;
  font-size:20px;
  width:300px;
  min-height:30px;
  display:block;
  margin-bottom:15px;
  margin-top:5px;
  outline: none;

  -webkit-border-radius:5px;
  -moz-border-radius:5px;
  -o-border-radius:5px;
  -ms-border-radius:5px;
  border-radius:5px;
}

input[type=submit] {
  background:none;
  padding:10px;
}

#button{	
    background-color: #BAC3FF;
}

form p{
    font-size:medium;
}

Graveyard Database Logo

Has everything you want to know about grave yards. Plus has many celebrites and world leaders graves. Pssst it is my other site

Google + Profile
Check out Android Photo Mapping, its a app/site I been working on

  • wholesale nfl jerseys
  • wholesale nfl jerseys china
  • wholesale sports jerseys