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

How To Receive a Cookie from the Browser
How To Receive a Cookie from the Browser? - PHP Script Tips - Understanding and Managing Cookies If you know that a cookie has been sent to the browser when it was visiting the server previously, you can check the built-in $_COOKIE array, which contains all cookies that were sent by the server previ...
2007-04-25, 4722👍, 0💬

What Is a Session
What Is a Session? - PHP Script Tips - Understanding and Using Sessions A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a sc...
2007-04-19, 4720👍, 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, 4717👍, 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, 4715👍, 0💬

How To Retrieve the Session ID of the Current Session
How To Retrieve the Session ID of the Current Session? - PHP Script Tips - Understanding and Using Sessions Normally, you don't need to know the session ID of the current session. But if you are interested to know the session ID created by the PHP engine, there are two ways to get it: Calling sessio...
2007-04-18, 4713👍, 0💬

How To Return a Value Back to the Function Caller
How To Return a Value Back to the Function Caller? - PHP Script Tips - Creating Your Own Functions You can return a value to the function caller by using the "return $value" statement. Execution control will be transferred to the caller immediately after the return statement. If there are other stat...
2007-04-24, 4710👍, 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, 4709👍, 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, 4709👍, 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, 4707👍, 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, 4705👍, 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, 4704👍, 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, 4703👍, 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, 4700👍, 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, 4699👍, 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, 4698👍, 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, 4697👍, 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, 4695👍, 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, 4690👍, 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, 4690👍, 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, 4689👍, 0💬

How To Query Tables and Loop through the Returning Rows
How To Query Tables and Loop through the Returning Rows? - PHP Script Tips - Working with MySQL Database The best way to query tables and loop through the returning rows is to run the SELECT statement with the catch the mysql_query() function, catch the returning object as a result set, and loop thr...
2007-04-19, 4689👍, 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, 4681👍, 0💬

How To Download and Install PHP for Windows
How To Download and Install PHP for Windows? - PHP Script Tips - Downloading and Installing PHP The best way to download and install PHP on Windows systems is to: Go to http://www.php.net, which is the official Web site for PHP. Download PHP binary version for Windows in ZIP format. Unzip the downlo...
2007-04-22, 4680👍, 0💬

How To Read Data from Keyborad (Standard Input)
How To Read Data from Keyborad (Standard Input)? - PHP Script Tips - Reading and Writing Files If you want to read data from the standard input, usually the keyboard, you can use the fopen("php://stdin") function. It creates a special file handle linking to the standard input, and returns the file h...
2007-04-23, 4675👍, 0💬

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