<< < 1 2 3 4 5 6 7 8 9 > >>   Sort: Rank

Creating a Web Form in PHP
How To Create a Web Form in PHP? If you take input data from visitors on your Web site, you can create a Web form with input fields to allow visitors to fill in data and submit the data to your server for processing. A Web form can be created with the &lt;FORM&gt; tag with some input tags. T...
2016-11-17, 322👍, 0💬

Form Input HTML Tags in PHP
What Are Form Input HTML Tags in PHP? HTML tags that can be used in a form to collect input data are: &lt;SUBMIT ...&gt; - Displayed as a button allow users to submit the form. &lt;INPUT TYPE=TEXT ...&gt; - Displayed as an input field to take an input string. &lt;INPUT TYPE=RADIO...
2016-11-17, 316👍, 0💬

Generating a Form in PHP
How To Generate a Form in PHP? Generating a form seems to be easy. You can use PHP output statements to generate the required &lt;FORM&gt; tag and other input tags. But you should consider to organized your input fields in a table to make your form looks good on the screen. The PHP script be...
2016-11-17, 309👍, 0💬

Splitting a File Path Name into Parts in PHP
How To Break a File Path Name into Parts in PHP? If you have a file name, and want to get different parts of the file name, you can use the pathinfo() function. It breaks the file name into 3 parts: directory name, file base name and file extension; and returns them in an array. Here is a PHP script...
2016-11-17, 295👍, 0💬

$_GET, $_POST and $_REQUEST in PHP
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user entered data will be transferred to the PHP engine, which will make the submitted data available to your PHP script for processing in pre-defined arrays: $_GET - An associate array that store form data...
2016-11-15, 359👍, 0💬

Using isset($_REQUEST('name')) in PHP
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as shown in the previous exercise, you should consider checking all expected input fields in $_REQUEST with the isset() function as shown in the example script below: &lt;?php if (isset($_REQUEST['n...
2016-11-15, 339👍, 0💬

Retrieving Submitted Form Data in PHP
How To Retrieve the Submitted Form Data in PHP? The best way to retrieve the form data submitted by your visitor is to use the $_REQUEST array. The keys in this array will be the field names defined in form. The values in this array will be the values entered by your visitor in the input fields. The...
2016-11-15, 316👍, 0💬

Expected Input Field Not Submitted in PHP
What Happens If an Expected Input Field Was Not Submitted in PHP? Obviously, if an expected input field was not submitted, there will be no entry in the $_REQUEST array for that field. You may get an execution error, if you are not checking the existence of the expected entries in $_REQUEST. For exa...
2016-11-15, 312👍, 0💬

Listing All Values of Submitted Fields in PHP
How To List All Values of Submitted Fields in PHP? If you want list all values of submitted fields, you can write a simple loop to retrieve all entries in the $_REQUEST array. Below is an improved version of processing_forms.php to list all submitted input values: &lt;?php print("&lt;html&am...
2016-11-15, 294👍, 0💬

Specifying Input Values for Checkboxes in PHP
How To Specify Input Values for Checkboxes in PHP? Checkboxes can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=CHECKBOX ...&gt; tag, with no input value specified. When submitted with button pushed down, you will receive a value of "on". When submitted with b...
2016-11-13, 327👍, 0💬

Specifying Input Values for Radio Buttons in PHP
How To Specify Input Values for Radio Buttons in PHP? Radio buttons can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=RADIO ...&gt; tag, with no input value specified. When submitted with button pushed down, you will receive a value of "on". When submitted wit...
2016-11-13, 318👍, 0💬

Providing Default Values for Text Fields in PHP
How To Supply Default Values for Text Fields in PHP? If you want to provide a default value to a text field in your form, you need to pay attention to following notes: The default value should be provided in the 'VALUE=default_value' attribute in the &lt;INPUT TYPE=TEXT ...&gt; tag. The leng...
2016-11-13, 311👍, 0💬

Retrieving Input Values from Checkboxes in PHP
How To Retrieve Input Values for Checkboxes Properly in PHP? If multiple input values are submitted with the same field name, like the case of a group of checkboxes, you should add ([]) to the end of the field name. This tells the PHP engine that multiple values are expected for this field. The engi...
2016-11-13, 305👍, 0💬

Input Values of SELECT Tags in PHP
What Are Input Values of SELECT Tags in PHP? SELECT tags are used in forms to provide dropdown lists. Entries in a dropdown list are defined by OPTION tags, which can provide input values in two ways: Implicit value - Provided as &lt;OPTION&gt;input_va lue&lt;/OPTION&gt;,where input_...
2016-11-13, 289👍, 0💬

Submitting Values without Using a Form in PHP
How To Submit Values without Using a Form in PHP? If you know the values you want to submit, you can code the values in a hyper link at the end of the URL. The additional values provided at the end of a URL is called query string. There are two suggestions on how to use query strings to submit value...
2016-11-08, 727👍, 0💬

Removing Slashes on Submitted Input Values in PHP
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted to the PHP engine, it will add slashes to protect single quotes and double quotes. You should remove those slashes to get the original values by applying the stripslashes() function. Note that PHP eng...
2016-11-08, 638👍, 0💬

Generating and Processing Form with the Same Script in PHP
How To Generate and Process a Form with the Same Script in PHP? In previous exercises, a Web form is generated by one script, and processed by another script. But you could write a single script to do both. You just need to remember to: Use same script name as the form generation script in the "acti...
2016-11-08, 546👍, 0💬

Supporting Multiple Submit Buttons in PHP
How To Support Multiple Submit Buttons in PHP? Sometimes, you may need to give visitors multiple submit buttons on a single form to allow them to submit the form for different purposes. For example, when you show your customer a purchase order in a Web form, you may give your customer 3 submit butto...
2016-11-08, 343👍, 0💬

Supporting Hidden Form Fields in PHP
How To Support Hidden Form Fields in PHP? Hidden fields are special fields in a form that are not shown on the Web page. But when the form is submitted, values specified in the hidden fields are also submitted to the Web server. A hidden field can be specified with the &lt;INPUT TYPE=HIDDEN ...&...
2016-11-08, 331👍, 0💬

Supporting a Multiple-Page Form in PHP
How To Support Multiple-Page Forms in PHP? If you have a long form with a lots of fields, you may want to divide the fields into multiple groups and present multiple pages with one group of fields on one page. This makes the a long form more user-friendly. However, this requires you to write good sc...
2016-11-05, 593👍, 0💬

Retrieving the Original Query String in PHP
How To Retrieve the Original Query String in PHP? If you have coded some values in the URL without using the standard form GET format, you need to retrieve those values in the original query string in $_SERVER['QUERY_STRING']. The script below is an enhanced version of processing_forms.php which pri...
2016-11-05, 332👍, 0💬

Protecting Special Characters in Query String in PHP
How To Protect Special Characters in Query String in PHP? If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode(): &lt;?php print("&lt;html&gt;"); p...
2016-11-05, 326👍, 0💬

Understanding and Managing Cookies in PHP
Where to find tutorials on how to manage Cookies in PHP? A collection of tutorials to answer many frequently asked questions how to manage Cookies in PHP. Clear explanations and tutorial exercises are provided on setting and receiving cookies, creating and removing persistent cookies, specifying dom...
2016-11-05, 321👍, 0💬

What Is a Cookie in PHP
What Is a Cookie in PHP? A cookie is a small amount of information sent by a Web server to a web browser and then sent back unchanged by the browser each time it accesses that server. HTTP cookies are used for authenticating, tracking, and maintaining specific information about users, such as site p...
2016-11-05, 303👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 > >>   Sort: Rank