PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How can I access information sent through POST on a form?


If you are using a form on your website for instance a contact form that visitors use to get in touch with you, then you will most probably be using post, as in setting the method in your opening form tag to 'post'.

To access the data posted, you use the $_POST array like this:

Imagine you have a form field called 'name' on the form, when the user clicks submit to the post form, you can then access the value like this:

$_POST["name"]; and that's all there is to it!


More forms PHP Questions

How do I check that a valid email address is entered?
How can I check a value entered in a field on my form is a number?
How do I make a website field mandatory?
How do I remove escape characters from data?
How do I know if magic quotes is switched on?