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

Retrieving Directory Name from File Path Name in PHP
How To Get the Directory Name out of a File Path Name in PHP? If you have the full path name of a file, and want to get the directory name portion of the path name, you can use the dirname() function. It breaks the full path name at the last directory path delimiter (/) or (\), and returns the first...
2016-11-20, 1594🔥, 0💬

Copying a File in PHP
How To Copy a File in PHP? If you have a file and want to make a copy to create a new file, you can use the copy() function. Here is a PHP script example on how to use copy(): &lt;?php unlink("/temp/myPing.exe"); copy("/windows/system32/ping.e xe","/temp/myPing.exe"); if (file_exists("/temp/myPi...
2016-11-20, 1547🔥, 0💬

Removing a File in PHP
How To Remove a File in PHP? If you want to remove an existing file, you can use the unlink() function. Here is a PHP script example on how to use unlink(): &lt;?php if (file_exists("/temp/todo.txt") ){ unlink("/temp/todo.txt"); print("File removed.\n"); } else { print("File does not exist.\n");...
2016-11-20, 1508🔥, 0💬

Reading Directory Entries in PHP
How To Read a Directory One Entry at a Time in PHP? If you want to read a directory one entry at a time, you can use opendir() to open the specified directory to create a directory handle, then use readdir() to read the directory contents through the directory handle one entry at a time. readdir() r...
2016-11-20, 1458🔥, 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, 3673🔥, 0💬

Processing Web Forms in PHP
Where to find tutorials on how to process Web Forms in PHP? A collection of tutorials to answer many frequently asked questions on how to process Web Forms in PHP. Clear explanations and tutorial exercises are provided on generating and processing Web forms, getting values out of $_REQUEST, processi...
2016-11-17, 1838🔥, 0💬

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, 1764🔥, 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, 1644🔥, 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, 1509🔥, 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, 3691🔥, 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, 3447🔥, 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, 1763🔥, 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, 1502🔥, 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, 1404🔥, 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, 1535🔥, 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, 1521🔥, 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, 1502🔥, 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, 1463🔥, 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, 1462🔥, 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, 3053🔥, 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, 2390🔥, 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, 1997🔥, 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, 1593🔥, 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, 2080🔥, 0💬

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