1 2 3 4 5 6 > >>   Sort: Date

How To Retrieve Input Values for Checkboxes Properly
How To Retrieve Input Values for Checkboxes Properly? - PHP Script Tips - Processing Web Forms 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...
2016-06-26, 12924👍, 1💬

💬 2016-06-26 Donald: Thanks.

How To Avoid the Undefined Index Error
How To Avoid the Undefined Index Error? - PHP Script Tips - Processing Web Forms 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: &...
2007-04-23, 11887👍, 0💬

How To Merge Values of Two Arrays into a Single Array
How To Merge Values of Two Arrays into a Single Array? - PHP Script Tips - PHP Built-in Functions for Arrays You can use the array_merge() function to merge two arrays into a single array. array_merge() appends all pairs of keys and values of the second array to the end of the first array. Here is a...
2007-04-21, 9632👍, 0💬

File Upload Handling - Getting Uploaded File Information
How To Get the Uploaded File Information in the Receiving PHP Script? Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array calle...
2016-06-30, 9505👍, 2💬

Octal and Decimal Numbers
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what's the problem? If you assign a variable with a value of 0123, PHP will interpret as an octal number resulting to decimal value of 83. All numbers that preceded with a 0 (zero) will be interpreted...
2007-02-27, 8915👍, 0💬

How To Use an Array as a Queue
How To Use an Array as a Queue? - PHP Script Tips - PHP Built-in Functions for Arrays A queue is a simple data structure that manages data elements following the first-in-first-out rule. You use the following two functions together to use an array as a queue: array_push($array, $value) - Pushes a ne...
2007-04-21, 8603👍, 0💬

Tag <?= ... ?> in PHP
What does a special set of tags <?= and ?> do in a PHP script page? <?= expression ?> allows you to output the value of the specified expression into the HTML document directly.
2006-09-01, 8463👍, 0💬

How Large Can a Single Cookie Be
How Large Can a Single Cookie Be? - PHP Script Tips - Understanding and Managing Cookies How large can a single cookie be? The answer is depending what is the Web browser your visitor is using. Each browser has its own limit: Internet Explorere (IE): about 3904 bytes Mozilla FireFox: about 3136 byte...
2007-04-24, 8455👍, 0💬

How To Compare Two Strings with strcmp()
How To Compare Two Strings with strcmp()? - PHP Script Tips - PHP Built-in Functions for Strings PHP supports 3 string comparison operators, <, ==, and >, that generates Boolean values. But if you want to get an integer result by comparing two strings, you can the strcmp() function, wh...
2007-04-21, 7763👍, 0💬

Expression Evaluation
What is the value of this expression? +1-2*3/4 -0.5
2006-09-01, 7762👍, 0💬

How To Truncate an Array
How To Truncate an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you want to remove a chunk of values from an array, you can use the array_splice($array, $offset, $length) function. $offset defines the starting position of the chunk to be removed. If $offset is positive, it is coun...
2007-04-21, 7756👍, 0💬

How To Set session.gc_divisor Properly
How To Set session.gc_divisor Properly? - PHP Script Tips - Understanding and Using Sessions As you know that session.gc_divisor is the frequency of when the session garbage collection process will be executed. You should set this value based on the income request traffic. Here are some suggestions:...
2007-04-18, 7522👍, 0💬

How To Get the Minimum or Maximum Value of an Array
How To Get the Minimum or Maximum Value of an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you want to get the minimum or maximum value of an array, you can use the min() or max() function. Here is a PHP script on how to use min() and max(): <?php $array = array(5, 7, 6, 2,...
2007-04-22, 7299👍, 0💬

How To Get the Last ID Assigned by MySQL
How To Get the Last ID Assigned by MySQL? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts If you use an ID column with AUTO_INCREMENT attribute, you can use the mysql_insert_id() function to get the last ID value assigned by the MySQL server, as shown in the sample script below: ...
2007-05-11, 7158👍, 0💬

mysql_fetch_object() and mysql_fetch_array() Functions
What is the difference between mysql_fetch_object() and mysql_fetch_array() functions in PHP? mysql_fetch_object() fetches the current row of data from the query result associated with the specified result identifier. The row is returned as an object. See the example code: <?php $result = mys...
2007-02-27, 7096👍, 0💬

How To Build WHERE Criteria with Web Form Search Fields
How To Build WHERE Criteria with Web Form Search Fields? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts If your PHP script is linked to a Web form which takes search key words for multiple data fields. For example, your Web form asks your visitor to search for Website links with...
2007-05-11, 7074👍, 0💬

Where Is the Submitted Form Data Stored
Where Is the Submitted Form Data Stored? - PHP Script Tips - Processing Web Forms 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 as...
2007-04-23, 6987👍, 0💬

How To Dump the Contents of a Directory into an Array
How To Dump the Contents of a Directory into an Array? - PHP Script Tips - Working with Directoris and Files If you want to get the contents of a directory into an array, you can use the scandir() function. It gets a list of all the files and sub directories of the specified directory and returns th...
2007-04-23, 6953👍, 0💬

How To Display a Past Time in Days, Hours and Minutes
How To Display a Past Time in Days, Hours and Minutes? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts You have seen a lots of Websites are displaying past times in days, hours and minutes. If you want to do this yourself, you can use the TIMEDIFF() SQL function. Note that the TI...
2007-05-11, 6891👍, 0💬

How To Set session.gc_maxlifetime Properly
How To Set session.gc_maxlifetime Properly? - PHP Script Tips - Understanding and Using Sessions As you know that session.gc_maxlifetime is the session value timeout period. You should set this value based on the usage pattern of your visitors. Here are some suggestions: # Set it to 20 minutes for a...
2007-04-18, 6794👍, 0💬

How To Join a List of Keys with a List of Values into an Array
How To Join a List of Keys with a List of Values into an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you have a list keys and a list of values stored separately in two arrays, you can join them into a single array using the array_combine() function. It will make the values of the...
2007-04-21, 6736👍, 0💬

urlencode() and urldecode() Functions?
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encoded version: Alphanumeric characters are maintained as is. Space characters are conv...
2007-02-27, 6685👍, 0💬

How To Insert Multiple Rows with a SELECT Statement
How To Insert Multiple Rows with a SELECT Statement? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts If want to insert rows into a table based on data rows from other tables, you can use a sub-query inside the INSERT statement as shown in the following script example: <?ph...
2007-05-10, 6647👍, 0💬

How To List All Values of Submitted Fields
How To List All Values of Submitted Fields? - PHP Script Tips - Processing Web Forms 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 submited input values: &a...
2007-04-23, 6633👍, 0💬

1 2 3 4 5 6 > >>   Sort: Date