<< < 4 5 6 7 8 9 10 11 > >>   Sort: Date

How To Copy a File
How To Copy a File? - PHP Script Tips - Working with Directoris and Files 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","...
2007-04-23, 4597👍, 0💬

How To Support Hidden Form Fields
How To Support Hidden Form Fields? - PHP Script Tips - Processing Web Forms 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 ...
2007-04-22, 4592👍, 0💬

What Are the Special Characters You Need to Escape in Double-Quoted Stings
What Are the Special Characters You Need to Escape in Double-Quoted Stings? - PHP Script Tips - Understanding String Literals and Operations There are two special characters you need to escape in a double-quote string: the double quote (") and the back slash (\). Here is a PHP script example of doub...
2007-04-20, 4592👍, 0💬

What's Wrong with "while ($c=fgetc($f)) {}"
What's Wrong with "while ($c=fgetc($f)) {}"? - PHP Script Tips - Reading and Writing Files If you are using "while ($c=fgetc($f)) {}" to loop through each character in a file, the loop may end in the middle of the file when there is a "0" character, because PHP treats "0" as Boolean false. To proper...
2007-04-22, 4591👍, 0💬

How To Pass Arrays By References
How To Pass Arrays By References? - PHP Script Tips - Creating Your Own Functions Like normal variables, you can pass an array by reference into a function by taking a reference of the original array, and passing the reference to the function. Here is a PHP script on how to pass array as reference: ...
2007-04-24, 4590👍, 0💬

How To Support Multiple-Page Forms
How To Support Multiple-Page Forms? - PHP Script Tips - Processing Web Forms 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, ...
2007-04-22, 4588👍, 0💬

How To Get the Number of Characters in a String
How To Get the Number of Characters in a String? - PHP Script Tips - PHP Built-in Functions for Strings You can use the "strlen()" function to get the number of characters in a string. Here is a PHP script example of strlen(): &lt;?php print(strlen('It\'s Friday!')); ?&gt; This script will p...
2007-04-22, 4587👍, 0💬

How the Values Are Ordered in an Array
How the Values Are Ordered in an Array? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations PHP says that an array is an ordered map. But how the values are ordered in an array? The answer is simple. Values are stored in the same order as they are inserted like a queue. If you wa...
2007-04-20, 4586👍, 0💬

How To Return a Reference from a Function
How To Return a Reference from a Function? - PHP Script Tips - Creating Your Own Functions To return a reference from a function, you need to: Add the reference operator "&" when defining the function. Add the reference operator "&" when invoking the function. Here is a PHP script on how to ...
2007-04-14, 4586👍, 0💬

How To Remove an Empty Directory
How To Remove an Empty Directory? - PHP Script Tips - Working with Directoris and Files If you have an empty existing directory and you want to remove it, you can use the rmdir(). Here is a PHP script example on how to use rmdir(): &lt;?php if (file_exists("/temp/download") ){ rmdir("/temp/downl...
2007-04-23, 4584👍, 0💬

How To Get the Uploaded File Information in the Receiving Script
How To Get the Uploaded File Information in the Receiving Script? - PHP Script Tips - Uploading Files to Web Servers 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...
2007-04-19, 4584👍, 0💬

How To Read a Directory One Entry at a Time
How To Read a Directory One Entry at a Time? - PHP Script Tips - Working with Directoris and Files 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 di...
2007-04-23, 4583👍, 0💬

Can You Define an Argument as a Reference Type
Can You Define an Argument as a Reference Type? - PHP Script Tips - Creating Your Own Functions You can define an argument as a reference type in the function definition. This will automatically convert the calling arguments into references. Here is a PHP script on how to define an argument as a ref...
2007-04-24, 4580👍, 0💬

How Values in Arrays Are Indexed
How Values in Arrays Are Indexed? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations Values in an array are all indexed their corresponding keys. Because we can use either an integer or a string as a key in an array, we can divide arrays into 3 categories: Numerical Array - All ...
2007-04-20, 4580👍, 0💬

How To Drop an Existing Database
How To Drop an Existing Database? - MySQL FAQs - PHP Connections and Query Execution If want to drop an existing database from the MySQL server, you can use the DROP DATABASE statement. Here is a good example of dropping an existing database: $con = mysql_connect('localhost:8888' ,'dev', 'iyf'); $sq...
2007-05-10, 4578👍, 0💬

How To Return an Array from a Function
How To Return an Array from a Function? - PHP Script Tips - Creating Your Own Functions You can return an array variable like a normal variable using the return statement. No special syntax needed. Here is a PHP script on how to return an array from a function: &lt;?php function powerBall() { $a...
2007-04-24, 4572👍, 0💬

How To Test Cookies on a Web Server
How To Test Cookies on a Web Server? - PHP Script Tips - Understanding and Managing Cookies If you want to test cookies with a browser, you need to run a Web server locally, or have access to a Web server remotely. Then you can copy the following PHP cookie test page, setting_receiving_cookies.php, ...
2007-04-25, 4567👍, 0💬

How To Open a File for Reading
How To Open a File for Reading? - PHP Script Tips - Reading and Writing Files If you want to open a file and read its contents piece by piece, you can use the fopen($fileName, "r") function. It opens the specified file, and returns a file handle. The second argument "r" tells PHP to open the file fo...
2007-04-22, 4564👍, 0💬

How To Get the Technical Specifications for File Upload
How To Get the Technical Specifications for File Upload? - PHP Script Tips - Uploading Files to Web Servers File upload technical specifications is provided in "Form-based File Upload in HTML - RFC 1867". You can get a copy from http://www.ietf.org/rfc/rfc186 7.txt.
2007-04-19, 4564👍, 0💬

Can You Specify the "new line" Character in Single-Quoted Strings
Can You Specify the "new line" Character in Single-Quoted Strings? - PHP Script Tips - Understanding String Literals and Operations You can not specify the "new line" character in a single-quoted string. If you don't believe, try this script: &lt;?php echo '\n will not work in single quoted stri...
2007-04-20, 4563👍, 0💬

How To Get the Number of Rows Selected or Affected by a SQL Statement
How To Get the Number of Rows Selected or Affected by a SQL Statement? - PHP Script Tips - Working with MySQL Database There are two functions you can use the get the number of rows selected or affected by a SQL statement: mysql_num_rows($rs) - Returns the number of rows selected in a result set obj...
2007-04-19, 4561👍, 0💬

Is It More Secure to Use Cookies to Transfer Session IDs
Is It More Secure to Use Cookies to Transfer Session IDs? - PHP Script Tips - Understanding and Using Sessions Is it more secure to use cookies to transfer session IDs? The answer is yes, because attacking your Web site using URL parameters is much easier than using cookies. So if you are the system...
2007-04-17, 4561👍, 0💬

What Do You Need to Connect PHP to MySQL
What Do You Need to Connect PHP to MySQL? - PHP Script Tips - Working with MySQL Database If you want to access MySQL database server in your PHP script, you need to make sure that MySQL module is installed and turned on in your PHP engine. Check the PHP configuration file, php.ini, to make sure the...
2007-04-18, 4557👍, 0💬

How To Delete Cookie Files on Your Computer
How To Delete Cookie Files on Your Computer? - PHP Script Tips - Understanding and Managing Cookies A simple way to delete cookie files on your computer is to use the function offered by the IE browser. The following tutorial exercise shows you how to delete cookie files created by IE: Open IE (Inte...
2007-04-24, 4555👍, 0💬

<< < 4 5 6 7 8 9 10 11 > >>   Sort: Date