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

How To Read One Character from a File
How To Read One Character from a File? - PHP Script Tips - Reading and Writing Files If you have a text file, and you want to read the file one character at a time, you can use the fgetc() function. It reads the current character, moves the file pointer to the next character, and returns the charact...
2007-04-22, 4837👍, 0💬

What Is an Array in PHP
What Is an Array in PHP? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations An array in PHP is really an ordered map of pairs of keys and values. Comparing with Perl, an array in PHP is not like a normal array in Perl. An array in PHP is like an associate array in Perl. But an a...
2007-04-20, 4833👍, 0💬

How View the Content of a Cookie File
How View the Content of a Cookie File? - PHP Script Tips - Understanding and Managing Cookies Cookie files are normal text files. You can view them with any text editor. Follow the steps below to see what is in a cookie file created by your own PHP script. Copy the following sample script, setting_p...
2007-04-24, 4829👍, 0💬

How To View Cookie Header Lines
How To View Cookie Header Lines? - PHP Script Tips - Understanding and Managing Cookies If you are interested to see the cookie header lines, or you are having trouble with your cookies and need to see the cookies to help debugging, you can run your script with PHP CGI interface in a command line wi...
2007-04-24, 4822👍, 0💬

How To Replace a Substring in a Given String
How To Replace a Substring in a Given String? - PHP Script Tips - PHP Built-in Functions for Strings If you know the position of a substring in a given string, you can replace that substring by another string by using the substr_replace() function. Here is a PHP script on how to use substr_replace()...
2007-04-21, 4822👍, 0💬

How To Generate a Character from an ASCII Value
How To Generate a Character from an ASCII Value? - PHP Script Tips - PHP Built-in Functions for Strings If you want to generate characters from ASCII values, you can use the chr() function. chr() takes the ASCII value in decimal format and returns the character represented by the ASCII value. chr() ...
2007-04-21, 4822👍, 0💬

How Do You If a Key Is Defined in an Array
How Do You If a Key Is Defined in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays There are two functions can be used to test if a key is defined in an array or not: array_key_exists($key, $array) - Returns true if the $key is defined in $array. isset($array[$key]) - Returns true if ...
2007-04-20, 4818👍, 0💬

What Is a Session ID
What Is a Session ID? - PHP Script Tips - Understanding and Using Sessions A session ID is an identification string of a session. Since there might be multiple visitors coming to your Web site at the same time, the PHP engine needs to maintain multiple sessions concurrently. Session IDs are created ...
2007-04-18, 4817👍, 0💬

How To Close MySQL Connection Objects
How To Close MySQL Connection Objects? - MySQL FAQs - PHP Connections and Query Execution MySQL connection objects created with mysql_connect() calls should be closed as soon as you have finished all of your database access needs by calling mysql_close($con) function. This will reduce the consumptio...
2007-05-10, 4814👍, 0💬

How To Remove the New Line Character from the End of a Text Line
How To Remove the New Line Character from the End of a Text Line? - PHP Script Tips - PHP Built-in Functions for Strings If you are using fgets() to read a line from a text file, you may want to use the chop() function to remove the new line character from the end of the line as shown in this PHP sc...
2007-04-22, 4814👍, 0💬

How To Loop through an Array without Using "foreach"
How To Loop through an Array without Using "foreach"? - PHP Script Tips - PHP Built-in Functions for Arrays PHP offers the following functions to allow you loop through an array without using the "foreach" statement: reset($array) - Moves the array internal pointer to the first value of the array an...
2007-04-14, 4814👍, 0💬

What Are the Options to Transfer Session IDs
What Are the Options to Transfer Session IDs? - PHP Script Tips - Understanding and Using Sessions Once a new session is created, its session ID must be transferred to the client browser and included in the next client request, so that the PHP engine can find the same session created by the same vis...
2007-04-18, 4813👍, 0💬

How To Close a Session Properly
How To Close a Session Properly? - PHP Script Tips - Understanding and Using Sessions Let's say you site requires users to login. When a logged in user clicks the logout button, you need to close the session associated with this user properly in 3 steps: Remove all session values with $_SESSION = ar...
2007-04-17, 4808👍, 0💬

How Session IDs Are Transferred on Your Web Server
How Session IDs Are Transferred on Your Web Server? - PHP Script Tips - Understanding and Using Sessions As you know there are two options the PHP engine can use to transfer session IDs to the client browsers. But how to do know which option is your PHP engine is using? The PHP sample script will he...
2007-04-18, 4805👍, 0💬

How To Concatenate Two Strings Together
How To Concatenate Two Strings Together? - PHP Script Tips - Understanding String Literals and Operations You can use the string concatenation operator (.) to join two strings into one. Here is a PHP script example of string concatenation: &lt;?php echo 'Hello ' . "world!\n"; ?&gt; This scri...
2007-04-20, 4804👍, 0💬

How To Send a Cookie to the Browser
How To Send a Cookie to the Browser? - PHP Script Tips - Understanding and Managing Cookies If you want to sent a cookie to the browser when it comes to request your PHP page, you can use the setcookie( ) function. Note that you should call setcookie() function before any output statements. The foll...
2007-04-25, 4803👍, 0💬

How To Create a Database
How To Create a Database? - PHP Script Tips - Working with MySQL Database A database in a MySQL server is a logical container used to group tables and other data objects together as a unit. If you are a the administrator of the server, you can create and delete databases using the CREATE/DROP DATABA...
2007-04-18, 4803👍, 0💬

How To Support Multiple Submit Buttons
How To Support Multiple Submit Buttons? - PHP Script Tips - Processing Web Forms Sometimes, you may need to give visitors multiple submit buttons on a single form to allow them to submit the form for different purposes. For example, when you show your customer a purchase order in a Web form, you may...
2007-04-22, 4798👍, 0💬

How To Uploaded Files to a Table
How To Uploaded Files to a Table? - PHP Script Tips - Uploading Files to Web Servers To store uploaded files to MySQL database, you can use the normal SELECT statement as shown in the modified processing_uploaded_files.php listed below: &lt;?php $con = mysql_connect("localhost", "", ""); mysql_s...
2007-04-19, 4798👍, 0💬

How To Set a Persistent Cookie
How To Set a Persistent Cookie? - PHP Script Tips - Understanding and Managing Cookies If you want to set a persistent cookie, you can use the setcookie() function with an extra parameter to specify its expiration time. To follow sample script sets 2 persistent cookies to be expired within 7 days: s...
2007-04-25, 4793👍, 0💬

How To Run a PHP Script
How To Run a PHP Script? - PHP Script Tips - Downloading and Installing PHP A standard alone PHP script can be executed directly with the PHP Command Line Interface (CLI). Write the following script in a file called hello.php: &lt;?php echo "Hello world!"; ?&gt; This script can be executed b...
2007-04-22, 4787👍, 0💬

How To Insert Data into an Existing Table
How To Insert Data into an Existing Table? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts If you want to insert a row of data into an existing table, you can use the INSERT INTO statement as shown in the following sample script: &lt;?php include "mysql_connection.php"; $sql ...
2007-05-10, 4785👍, 0💬

How To Get All the Values Out of an Array
How To Get All the Values Out of an Array? - PHP Script Tips - PHP Built-in Functions for Arrays Function array_values() returns a new array that contains all the keys of a given array. Here is a PHP script on how to use array_values(): &lt;?php $mixed = array(); $mixed["Zero"] = "PHP"; $mixed[1...
2007-04-21, 4782👍, 0💬

How To Retrieve Values from the Current Session
How To Retrieve Values from the Current Session? - PHP Script Tips - Understanding and Using Sessions If you know some values have been saved in the session by an other script requested by the same visitor, you can retrieve those values back by using the pre-defined associative array called $_SESSIO...
2007-04-18, 4772👍, 0💬

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