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

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, 5711👍, 0💬

How To Quote Text Values in SQL Statements
How To Quote Text Values in SQL Statements? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts Text values in SQL statements should be quoted with single quotes ('). If the text value contains a single quote ('), it should be protected by replacing it with two single quotes (''). In...
2007-05-11, 5698👍, 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, 5675👍, 0💬

Where Are the Persistent Cookies Stored on Your Computer
Where Are the Persistent Cookies Stored on Your Computer? - PHP Script Tips - Understanding and Managing Cookies The location and file names where persistent cookies are stored on your computer depend on which browser you are using. If you using Microsoft Internet Explorer, persistent cookies are st...
2007-04-24, 5649👍, 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, 5621👍, 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, 5619👍, 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, 5600👍, 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, 5597👍, 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, 5595👍, 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, 5585👍, 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, 5585👍, 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, 5582👍, 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, 5581👍, 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, 5556👍, 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, 5556👍, 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, 5547👍, 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, 5542👍, 0💬

How to Find a Substring from a Given String
How to Find a Substring from a Given String? - PHP Script Tips - PHP Built-in Functions for Strings To find a substring in a given string, you can use the strpos() function. If you call strpos($haystack, $needle), it will try to find the position of the first occurrence of the $needle string in the ...
2007-04-21, 5533👍, 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, 5522👍, 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, 5508👍, 0💬

How To Connect to a MySQL Sever with a Port Number
How To Connect to a MySQL Sever with a Port Number? - MySQL FAQs - PHP Connections and Query Execution If you want to connect a MySQL server with a non-default port number, you need to use the "mysql_connect($server)" function with $server in the format of "hostName:portNubmber". The tutorial exerci...
2007-05-10, 5499👍, 0💬

What Happens If You Do Not Have Privileges to Create Database
What Happens If You Do Not Have Privileges to Create Database? - MySQL FAQs - PHP Connections and Query Execution If your MySQL server is provided by your Internet service company, your user account will most likely have no privilege to create new databases on the server. In that case, your CREATE D...
2007-05-10, 5496👍, 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, 5476👍, 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, 5476👍, 0💬

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