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

How To Sort an Array by Values
How To Sort an Array by Values? - PHP Script Tips - PHP Built-in Functions for Arrays Sorting an array by values is doable by using the sort() function. It will re-order all pairs of keys and values based on the alphanumeric order of the values. Then it will replace all keys with integer keys sequen...
2007-04-21, 5316👍, 0💬

How To Remove Slashes on Submitted Input Values
How To Remove Slashes on Submitted Input Values? - PHP Script Tips - Processing Web Forms 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 stripsla...
2007-04-22, 5315👍, 0💬

What Are Domain and Path Attributes for Cookies
What Are Domain and Path Attributes for Cookies? - PHP Script Tips - Understanding and Managing Cookies Cookies can also be defined with two other attributes: Domain - A cookie attribute that defines the domain name of Web servers where this cookie is valid. Web browsers holding this cookie should n...
2007-04-24, 5312👍, 0💬

Uploading Files with File Input Fields in a Form
How To Write the FORM Tag Correctly for Uploading Files? When users clicks the submit button, files specified in the &lt;INPUT TYPE=FILE...> will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written &lt;FORM...> tag as: ...
2007-02-27, 5312👍, 0💬

How To Convert Strings in Hex Format
How To Convert Strings in Hex Format? - PHP Script Tips - PHP Built-in Functions for Strings If you want convert a string into hex format, you can use the bin2hex() function. Here is a PHP script on how to use bin2hex(): &lt;?php $string = "Hello\tworld!\n"; print($string."\n"); print(bin2hex($s...
2007-04-21, 5307👍, 0💬

How To Read a File in Binary Mode
How To Read a File in Binary Mode? - PHP Script Tips - Reading and Writing Files If you have a file that stores binary data, like an executable program or picture file, you need to read the file in binary mode to ensure that none of the data gets modified during the reading process. You need to: Ope...
2007-04-23, 5304👍, 0💬

How To Split a String into Pieces
How To Split a String into Pieces? - PHP Script Tips - PHP Built-in Functions for Strings There are two functions you can use to split a string into pieces: explode(substring, string) - Splitting a string based on a substring. Faster than split(). split(pattern, string) - Splitting a string based on...
2007-04-21, 5300👍, 0💬

How To Get the Last ID Assigned by MySQL
How To Get the Last ID Assigned by MySQL? - PHP Script Tips - Working with MySQL Database 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: &lt;?php include...
2007-04-18, 5295👍, 0💬

How To Use MySQL Command Line Interface
How To Use MySQL Command Line Interface? - PHP Script Tips - Working with MySQL Database MySQL server comes with a command line interface, which will allow you to operate with the server with SQL statements and other commands. To start the command line interface, you can run the \mysql\bin\mysql pro...
2007-04-18, 5292👍, 0💬

What Are the File Upload Settings in Configuration File
What Are the File Upload Settings in Configuration File? - PHP Script Tips - Uploading Files to Web Servers There are several settings in the PHP configuration file related to file uploading: file_uploads = On/Off - Whether or not to allow HTTP file uploads. upload_tmp_dir = directory - The temporar...
2007-04-19, 5290👍, 0💬

What Is session_register()
What Is session_register()? - PHP Script Tips - Understanding and Using Sessions session_register() is old function that registers global variables into the current session. You should stop using session_register() and use array $_SESSION to save values into the current session now.
2007-04-14, 5289👍, 0💬

How To Convert the First Character to Upper Case
How To Convert the First Character to Upper Case? - PHP Script Tips - PHP Built-in Functions for Strings If you are processing an article, you may want to capitalize the first character of a sentence by using the ucfirst() function. You may also want to capitalize the first character of every words ...
2007-04-21, 5277👍, 0💬

How To Supply Default Values for Text Fields
How To Supply Default Values for Text Fields? - PHP Script Tips - Processing Web Forms 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 &ltINPUT TY...
2007-04-22, 5257👍, 0💬

How To Delete Existing Rows in a Table
How To Delete Existing Rows in a Table? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts If you want to remove a row from a table, you can use the DELETE statement with a WHERE clause to identify the row. The following sample script deletes one row: &lt;?php include "mysql_con...
2007-05-11, 5248👍, 0💬

How Can Other Webmaster Steal Your Cookies
How Can Other Webmaster Steal Your Cookies? - PHP Script Tips - Understanding and Managing Cookies All browsers are following the security rule that your cookies are sent back only to your Web servers. They will not be sent to other Webmaster's Web server directly. However, other Webmaster may desig...
2007-04-23, 5242👍, 0💬

How To Remove White Spaces from the Beginning and/or the End of a String
How To Remove White Spaces from the Beginning and/or the End of a String? - PHP Script Tips - PHP Built-in Functions for Strings There are 4 PHP functions you can use remove white space characters from the beginning and/or the end of a string: trim() - Remove white space characters from the beginnin...
2007-04-22, 5227👍, 0💬

What Are Form Input HTML Tags
What Are Form Input HTML Tags? - PHP Script Tips - Processing Web Forms HTML tags that can be used in a form to collect input data are: &lt;SUBMIT ...> - Displayed as a button allow users to submit the form. &lt;INPUT TYPE=TEXT ...> - Displayed as an input field to take an input string. &...
2007-04-23, 5199👍, 0💬

How To Join Multiple Strings Stored in an Array into a Single String
How To Join Multiple Strings Stored in an Array into a Single String? - PHP Script Tips - PHP Built-in Functions for Arrays If you multiple strings stored in an array, you can join them together into a single string with a given delimiter by using the implode() function. Here is a PHP script on how ...
2007-04-21, 5188👍, 0💬

How To Get a List of Databases from MySQL Servers
How To Get a List of Databases from MySQL Servers? - MySQL FAQs - PHP Connections and Query Execution Once you got a MySQL server connection object successfully, you need to know what databases are available on the server and which database you should use to manage your tables and data. To get a lis...
2007-05-10, 5180👍, 0💬

How To Get Some Basic Information Back from MySQL Servers
How To Get Some Basic Information Back from MySQL Servers? - MySQL FAQs - PHP Connections and Query Execution Once you got a MySQL server connection object successfully, you can use mysql_get_server() and mysql_get_host_info() to get some basic information from your MySQL server. The tutorial exerci...
2007-05-10, 5170👍, 0💬

How To Split a String into an Array of Substring
How To Split a String into an Array of Substring? - PHP Script Tips - PHP Built-in Functions for Arrays There are two functions you can use to split a string into an Array of Substring: explode(substring, string) - Splitting a string based on a substring. Faster than split(). split(pattern, string) ...
2007-04-22, 5169👍, 0💬

What Happens If an Expected Input Field Was Not Submitted
What Happens If an Expected Input Field Was Not Submitted? - PHP Script Tips - Processing Web Forms Obviously, if an expected input field was not submitted, there will no entry in the $_REQUEST array for that field. You may get an execution error, if you are not checking the existence of the expecte...
2007-04-23, 5153👍, 0💬

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

How To Create an Array with a Sequence of Integers or Characters
How To Create an Array with a Sequence of Integers or Characters? - PHP Script Tips - PHP Built-in Functions for Arrays The quickest way to create an array with a sequence of integers or characters is to use the range() function. It returns an array with values starting with the first integer or cha...
2007-04-21, 5128👍, 0💬

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