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

Specifying Input Values for Radio Buttons in PHP
How To Specify Input Values for Radio Buttons in PHP? Radio buttons can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=RADIO ...&gt; tag, with no input value specified. When submitted with button pushed down, you will receive a value of "on". When submitted wit...
2016-11-13, 1472🔥, 0💬

Retrieving Input Values from Checkboxes in PHP
How To Retrieve Input Values for Checkboxes Properly in PHP? If multiple input values are submitted with the same field name, like the case of a group of checkboxes, you should add ([]) to the end of the field name. This tells the PHP engine that multiple values are expected for this field. The engi...
2016-11-13, 1471🔥, 0💬

What Is a Cookie in PHP
What Is a Cookie in PHP? A cookie is a small amount of information sent by a Web server to a web browser and then sent back unchanged by the browser each time it accesses that server. HTTP cookies are used for authenticating, tracking, and maintaining specific information about users, such as site p...
2016-11-05, 1463🔥, 0💬

Removing Values Saved in the Session in PHP
How To Remove Values Saved in the Current Session in PHP? If you want to remove values saved in the current session, you should use the unset() function on those saved values in $_SESSION, or use array() to empty $_SESSION: unset($_SESSION['MyColor']) - Removes one value named MyColor in the current...
2016-10-24, 1460🔥, 0💬

Closing a Session Properly in PHP
How To Close a Session Properly in PHP? 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 = array(). Remove the session ID cookie with the s...
2016-10-22, 1456🔥, 0💬

Detecting File Uploading Errors in PHP
How To Detect File Uploading Errors in PHP? If there was a problem for a file upload request specified by the &lt;INPUT TYPE=FILE NAME=fieldName...&gt; tag, an error code will be available in $_FILES[$fieldName]['error']. Possible error code values are: UPLOAD_ERR_OK (0) - There is no error,...
2016-10-14, 1453🔥, 0💬

FORM Tag for Uploading Files in PHP
How To Write the FORM Tag Correctly for Uploading Files in PHP? When users clicks the submit button, files specified in the &lt;INPUT TYPE=FILE...&gt; will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written &lt;FOR...
2016-10-17, 1451🔥, 0💬

Timeout Period on Session Values in PHP
What Is the Timeout Period on Session Values in PHP? The PHP engine has no direct settings on session timeout period. But it has a session garbage collection mechanism that you can set to remove those special files containing session values. There are 3 settings you can use to define the session gar...
2016-10-25, 1449🔥, 0💬

INPUT Tag for File Uploading in PHP
Which HTML Tag Allows Users to Specify a File for Uploading in PHP? To present an input field on your Web page to allow users to specify a local file to upload, you need to use the &lt;INPUT TYPE="FILE" ...&gt; tag inside a &lt;FORM ...&gt; tag. The &lt;INPUT TYPE="FILE" ...&...
2016-10-17, 1443🔥, 0💬

Opening a file for Reading in PHP
How To Open a File for Reading in PHP? 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 for reading. Once the file is open, you c...
2016-12-02, 1441🔥, 0💬

Sending a Cookie to the Browser in PHP
How To Send a Cookie to the Browser in PHP? 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 following script shows you how to set cookies: &...
2016-11-04, 1440🔥, 0💬

Performing Key Word Search in PHP
How To Perform Key Word Search in Tables in PHP? The simplest way to perform key word search is to use the SELECT statement with a LIKE operator in the WHERE clause. The LIKE operator allows you to match a text field with a keyword pattern specified as '%keyword%', where (%) represents any number of...
2016-10-17, 1439🔥, 0💬

Updating Existing Rows in PHP
How To Update Existing Rows in a Table in PHP? Updating existing rows in a table requires to run the UPDATE statement with a WHERE clause to identify the row. The following sample script updates one row with two new values: &lt;?php include "mysql_connection.php"; $sql = "UPDATE fyi_links SET no...
2016-10-19, 1438🔥, 0💬

Getting Uploaded File Information in PHP
How To Get the Uploaded File Information in the Receiving Script in PHP? 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 information through the predefined array ca...
2016-10-17, 1429🔥, 0💬

Removing an Empty Directory in PHP
How To Remove an Empty Directory in PHP? 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/download"); print("Directory removed.\n"); } else { ...
2016-11-24, 1424🔥, 0💬

Deleting Cookie Files in PHP
How To Delete Cookie Files on Your Computer in PHP? 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 (Internet Explorer) Go to Options/Internet Options Cl...
2016-11-02, 1418🔥, 0💬

Listing All Values of Submitted Fields in PHP
How To List All Values of Submitted Fields in PHP? If you want list all values of submitted fields, you can write a simple loop to retrieve all entries in the $_REQUEST array. Below is an improved version of processing_forms.php to list all submitted input values: &lt;?php print("&lt;html&am...
2016-11-15, 1414🔥, 0💬

Quoting Text Values in PHP
How To Quote Text Values in SQL Statements in PHP? 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 SQL language syntax, two single quotes represents one single...
2016-10-19, 1408🔥, 0💬

Security of Storing Session ID as a Cookie in PHP
Is It More Secure to Use Cookies to Transfer Session IDs in PHP? 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 administrator of your Web server, you should ...
2016-10-25, 1400🔥, 0💬

Determining If a Session Is New in PHP
How To Determine If a Session Is New in PHP? There is not direct way to tell if a session is new or old. But you can design your site to have a required session value in all sessions. Then you can check the existence of this value in a session to determine if it is a new session by isset($_SESSION['...
2016-10-24, 1397🔥, 0💬

Retrieving the Last Auto Increment ID in PHP
How To Get the Last ID Assigned by MySQL in PHP? 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 "mysql_connection.php"; $sql = "INSERT I...
2016-10-17, 1391🔥, 0💬

Receiving a Cookie from the Browser in PHP
How To Receive a Cookie from the Browser in PHP? 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 previously. The script below shows you how to pickup ...
2016-11-04, 1389🔥, 0💬

Retrieving Values out of an Array in PHP
How To Retrieve Values out of an Array in PHP? You can retrieve values out of arrays using the array element expression $array[$key]. Here is a PHP example script: &lt;?php $languages = array(); $languages["Zero"] = "PHP"; $languages["One"] = "Perl"; $languages["Two"] = "Java"; print("Array with...
2016-10-15, 1375🔥, 0💬

Deleting Existing Rows in PHP
How To Delete Existing Rows in a Table in PHP? 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_connection.php"; $sql = "DELETE FROM fyi_links WHERE id = 1102";...
2016-10-19, 1334🔥, 0💬

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