Category: php

.

When learning PHP to build a website, one of the very first things that any newcomer, or beginner needs to learn is how to use HTML or XHTML (both will mean the same for this tutorial.) forms to collect information from users. Those data are usually email addresses, names, birthdays, and sometimes private information like credit card info, SSN, and home addresses. (The scripts in this tutorial are not meant for processing security sensitive data. It is only intended to teach you how to use forms with PHP variables, and get that information from the server into your script.) Just in case you are not very familiar with HTML forms, we will start with a quick beginner's how-to with forms.

In the HTML form below, I will collect a user's first and last name

<form action="test.php" method="post"> First Name: <input type="text" name="first_name" /> Last Name: <input type="text" name="last_name" /> <input type="submit" name="submit" /> </form>

Here is an explanation, top to bottom, of the various functions performed by the above HTML attributes.

Form - Method When I submit my form to the server, method tells the server how to handle the information that was just collected. In this case I used post. This means that PHP will send variables to the server in what is called a (super-global.array) You will later access these variables to use them on another page. Arrays and super-global-arrays will be covered later in this tutorial.

Form - Action Tells the server to which script to send form data to for handling.

Input Input has two attributes that I used for this lesson. type is to tell Internet browsers what to display. In this instance it will be a text field. The value entered for name will actually become a string of text I will use to retrieve that particular bit of data from the PHP Super Global Array $_POST['first_name']. Finally, the submit button. This simply places a button image on the web page for clicking. When the submit button is clicked, all the information in my form is sent to the server.

Author: D.Shaun Morgan

how to upload images and files php Upload Images to Webserver HTML Form PHP Function # UPLOAD FILE function upload_file(){ echo '

how to use dreamweaver Dreamweaver - WISIWIG Dreamweaver is a tool that arguably could be called the industry standard for web design . Dreamweaver, is an Adobe product that originally b

Filezilla Filezilla Ftp Client, FTP SERVER vs Wsftp By: D.Shaun Morgan While I was writing this article, about halfway through, I realized that it would be unfair to tell my readers about

store images mysql php php Storing Images in Mysql Database Tutorial Outline: Creating a Test Mysql Database Example php Database Functio

how to write html form PHP php When learning PHP to build a website, one of the very first things that any newcomer, or beginner needs to learn is how to use HTML or XHTML (both will mean the same for this tutorial.) fo

.
 

Leave a Comment

how_to_write_html_form_PHP.php

Name:      | Email:      | Website:

Comment:


captcha

Enter The Above Security Code:


Author: nidhi | Website URL: |
Comment:
how can we attach the html content while sending mail in php
Re: Admin
not sure what your are asking. Are you asking about attachments?