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

Setting ID Column as Auto-Incremented in PHP
How To Set the ID Column as Auto-Incremented in PHP? Many tables require an ID column to assign a unique ID number for each row in the table. For example, if you have a table to hold forum member profiles, you need an ID number to identify each member. To allow MySQL server to automatically assign a...
2016-10-17, 1528🔥, 0💬

Converting Leading Characters to Upper Case in PHP
How To Convert Leading Characters to Upper Case? 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 for the article title by using the ucwords() function. H...
2016-10-13, 1527🔥, 0💬

What Is a Session in PHP
What Is a Session in PHP? 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 script can be retrieved by the same script or an...
2016-10-29, 1526🔥, 0💬

Passing an Argument to a Function in PHP
How To Pass an Argument to a Function? in PHP? To pass an argument to a function, you need to: Add an argument definition in the function definition. Add a value as an argument when invoking the function. Here is a PHP script on how to use arguments in a function(): &lt;?php function f2c($f) { r...
2016-12-24, 1525🔥, 0💬

Where Are Session Values Stored in PHP
Where Are Session Values Stored in PHP? When a value is saved into the current session by one PHP page, the PHP engine must store this value somewhere on Web server, so that the PHP engine can retrieve it back when same visitor comes back to request another PHP page. Where are the session values sto...
2016-10-25, 1525🔥, 0💬

Verifying If a Key Exists in an Array in PHP
How Do You Know If a Key Is Defined in an Array in PHP? 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 the $key is defined in $array. Here is a P...
2017-01-29, 1524🔥, 0💬

Invoking a User Function in PHP
How To Invoke a User Function? in PHP? You can invoke a function by entering the function name followed by a pair of parentheses. If needed, function arguments can be specified as a list of expressions enclosed in parentheses. Here is a PHP script example on how to invoke a user function: &lt;?p...
2016-12-28, 1523🔥, 0💬

Applying UUEncode to a String in PHP
How To Apply UUEncode to a String? UUEncode (Unix-to-Unix Encoding) is a simple algorithm to convert a string of any characters into a string of printable characters. UUEncode is reversible. The reverse algorithm is called UUDecode. PHP offers two functions for you to UUEncode or UUDecode a string: ...
2016-10-13, 1522🔥, 0💬

Configuration Settings for File Upload in PHP
What Are the File Upload Settings in Configuration File in PHP? 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 temporary directory used for storing files when doin...
2016-10-14, 1518🔥, 0💬

Generating a Form in PHP
How To Generate a Form in PHP? Generating a form seems to be easy. You can use PHP output statements to generate the required &lt;FORM&gt; tag and other input tags. But you should consider to organized your input fields in a table to make your form looks good on the screen. The PHP script be...
2016-11-17, 1515🔥, 0💬

Running a SQL Statement in PHP
How To Run a SQL Statement in PHP? You can run any types of SQL statements through the mysql_query() function. It takes the SQL statement as a string and returns different types of data depending on the SQL statement type and execution status: Returning FALSE, if the execution failed. Returning a re...
2016-10-20, 1515🔥, 0💬

Removing a File in PHP
How To Remove a File in PHP? If you want to remove an existing file, you can use the unlink() function. Here is a PHP script example on how to use unlink(): &lt;?php if (file_exists("/temp/todo.txt") ){ unlink("/temp/todo.txt"); print("File removed.\n"); } else { print("File does not exist.\n");...
2016-11-20, 1512🔥, 0💬

Expected Input Field Not Submitted in PHP
What Happens If an Expected Input Field Was Not Submitted in PHP? Obviously, if an expected input field was not submitted, there will be no entry in the $_REQUEST array for that field. You may get an execution error, if you are not checking the existence of the expected entries in $_REQUEST. For exa...
2016-11-15, 1510🔥, 0💬

Providing Default Values for Text Fields in PHP
How To Supply Default Values for Text Fields in PHP? 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 &lt;INPUT TYPE=TEXT ...&gt; tag. The leng...
2016-11-13, 1508🔥, 0💬

Retrieving Session ID from the Current Session in PHP
How To Retrieve the Session ID of the Current Session in PHP? 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 session() function. It will return the session ID va...
2016-10-26, 1507🔥, 0💬

Creating a Database in PHP
How To Create a Database in PHP? 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 the administrator of the server, you can create and delete databases using the CREATE/DROP DATABASE statements. The following PHP script sho...
2016-10-20, 1501🔥, 0💬

Information Needed for MySQL Connection in PHP
What Do You Need to Connect PHP to MySQL in PHP? 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 extension=php_mysql.dll is not commented...
2016-10-20, 1501🔥, 0💬

Retrieving the Original Query String in PHP
How To Retrieve the Original Query String in PHP? If you have coded some values in the URL without using the standard form GET format, you need to retrieve those values in the original query string in $_SERVER['QUERY_STRING']. The script below is an enhanced version of processing_forms.php which pri...
2016-11-05, 1496🔥, 0💬

Including Array Elements in Double-Quoted Strings in PHP
How Many Ways to Include Array Elements in Double-Quoted Strings? There are 2 formats to include array elements in double-quoted strings: "part 1 $array[key] part 2" - This is called simple format. In this format, you can not specify the element key in quotes. "part 1 {$array['key']} part 2" - This ...
2016-10-13, 1496🔥, 0💬

Ways to Include Variables in Double-Quoted Strings in PHP
How Many Ways to Include Variables in Double-Quoted Strings? There are 3 formats to include variables in double-quoted strings: "part 1 $variable part 2" - This is the simplest format to include a variable in a string. The variable name starts with the dollar sign and ends at the first character tha...
2016-10-13, 1482🔥, 0💬

Cookies Transported from Servers to Browsers in PHP
How Cookies Are Transported from Servers to Browsers in PHP? Cookies are transported from a Web server to a Web browser in the header area of the HTTP response message. Each cookie will be included in a separate "Set-Cookie:" header line in the following format: Set-Cookie: name=value; expires=time;...
2016-11-02, 1477🔥, 0💬

Reading Directory Entries in PHP
How To Read a Directory One Entry at a Time in PHP? 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 directory handle one entry at a time. readdir() r...
2016-11-20, 1471🔥, 0💬

Testing Persistent Cookies in PHP
How To Test Persistent Cookies in PHP? If you want to test persistent cookies, you can copy the following PHP script, setting_persistent_cookies.php ,to your Web server: &lt;?php setcookie("LoginName","FYICent er");setcookie("PreferredColor","Bl ue");setcookie("CouponNumber","0747 0433",time()+60...
2016-11-03, 1471🔥, 0💬

Firefox Storing Persistent Cookies in PHP
Where Does File Firefox Store Persistent Cookies in PHP? If you change Firefox to keep cookies "until they expire", Firefox will store persistent cookies from all Web servers in a single file at: \Documents and Settings\$user\Application Data\Mozilla \Firefox\Profiles\xby7vgys.def ault\cookie.txt.Op...
2016-10-30, 1470🔥, 0💬

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