You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Tutorial: PHP Form

No replies
geox's picture
User offline. Last seen 10 years 6 weeks ago. Offline
Joined: 02/25/2010
Posts: 4

A PHP form on a Web page allows a user to data that is sent to a server for processing. For example, the site almost every society contains a contact form so visitors can send a message to the owner of the site.

This form of contact usually contains a number of areas - the visitor's name to the e-mail and a key to the message. PHP forms similar to paper forms, because Internet users to complete forms with checkboxes, radio buttons or text boxes.

For example, the forms can be used to enter the shipping or credit card to order a product or can be used to retrieve data.

When dealing with HTML forms and PHP it is necessary to remember that any form element in HTML page will automatically be available to the PHP scripts.

<form>
     <table>
      <tr>
        <td>Name *</td>
        <td><input type="text"></td>
      </tr>
      <tr>
          <td>Email *</td>
          <td><input type="text"></td>
      </tr>
      <tr>
          <td>Phone</td>
          <td><input type="text"></td>
      </tr>
      <tr>
          <td>Field_check</td>
          <td>
             <input type="checkbox" value="1"><label>Check_1</label><br>
             <input type="checkbox" value="2"><label>Check_2</label><br>
             <input type="checkbox" value="3"><label>Check_3</label>
          </td>
      </tr>
      <tr>
          <td>Message *</td>
          <td><textarea rows="5"></textarea></td>
      </tr>
          <tr>
          <td colspan="2"> </td>
      </tr>
          <tr>
          <td colspan="2"> </td>
      </tr>
      <tr>
          <td><input type="button" id="subbut" value="Submit"></td>
      </tr>
     </table>
</form>

Use information from tutorials resource: http://phpforms.net/tutorial/tutorial.html