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

How To Copy Array Values to a List of Variables
How To Copy Array Values to a List of Variables? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations If you want copy all values of an array to a list of variable, you can use the list() construct on the left side of an assignment operator. list() will only take values with integ...
2007-04-20, 4846👍, 0💬

How To Generate and Process a Form with the Same Script
How To Generate and Process a Form with the Same Script? - PHP Script Tips - Processing Web Forms In previous exercises, a Web form is generated by one script, and processed by another script. But you could write a single script to do both. You just need to remember to: Use same script name as the f...
2007-04-22, 4844👍, 0💬

How To Fix the INSERT Command Denied Error
How To Fix the INSERT Command Denied Error? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts The reason for getting the "1142: INSERT command denied" error is that your user accound does not have the INSERT privilege on the table or database. To resolve this error, you need to ask...
2007-05-10, 4841👍, 0💬

How To Save Values to the Current Session
How To Save Values to the Current Session? - PHP Script Tips - Understanding and Using Sessions When session is turned on, a session will be automatically created for you by the PHP engine. If you want to save any values to the session, you can use the pre-defined associative array called $_SESSION....
2007-04-18, 4840👍, 0💬

How To Replace a Group of Characters by Another Group
How To Replace a Group of Characters by Another Group? - PHP Script Tips - PHP Built-in Functions for Strings While processing a string, you may want to replace a group of special characters with some other characters. For example, if you don't want to show user's email addresses in the original for...
2007-04-20, 4838👍, 0💬

How To Perform Key Word Search in Tables
How To Perform Key Word Search in Tables? - PHP Script Tips - Working with MySQL Database 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 '%keyw...
2007-04-19, 4838👍, 0💬

How To Connect to a MySQL Sever with Default Port Number
How To Connect to a MySQL Sever with Default Port Number? - MySQL FAQs - PHP Connections and Query Execution If you want to connect a MySQL server with default port number, you can use the "mysql_connect($server)" function, where $server is the host name or IP address where the MySQL server is runni...
2007-05-10, 4831👍, 0💬

How To Detect File Uploading Errors
How To Detect File Uploading Errors? - PHP Script Tips - Uploading Files to Web Servers If there was a problem for a file upload request specified by the &lt;INPUT TYPE=FILE NAME=fieldName...> tag, an error code will be available in $_FILES[$fieldName]['error']. Possible error code values are: U...
2007-04-19, 4829👍, 0💬

How To Connect to MySQL Severs with User Accounts
How To Connect to MySQL Severs with User Accounts? - MySQL FAQs - PHP Connections and Query Execution If you want to connect a MySQL server with user account name and password, you need to call mysql_connect() with more parameters like this: $con = mysql_connect($server, $username, $password); If yo...
2007-05-10, 4820👍, 0💬

Can You Define an Array Argument as a Reference Type
Can You Define an Array Argument as a Reference Type? - PHP Script Tips - Creating Your Own Functions You can define an array 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 array...
2007-04-24, 4816👍, 0💬

How To Create a Web Form
How To Create a Web Form? - PHP Script Tips - Processing Web Forms If you take input data from visitors on your Web site, you can create a Web form with input fields to allow visitors to fill in data and submit the data to your server for processing. A Web form can be created with the &lt;FORM> ...
2007-04-23, 4810👍, 0💬

How To Test the Session Garbage Collection Process
How To Test the Session Garbage Collection Process? - PHP Script Tips - Understanding and Using Sessions In order to test the session garbage collection process, you need to change the settings to expire session variables in 10 seconds and run the process on every request: session.gc_probability = 1...
2007-04-18, 4809👍, 0💬

How To Specify Input Values for Radio Buttons
How To Specify Input Values for Radio Buttons? - PHP Script Tips - Processing Web Forms Radio buttons can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=RADIO ...> tag, with no input value specified. When submitted with button pushed down, you will receive a value ...
2007-04-23, 4807👍, 0💬

What Happens If You Do Not Have Privileges to Create Database
What Happens If You Do Not Have Privileges to Create Database? - MySQL FAQs - PHP Connections and Query Execution If your MySQL server is provided by your Internet service company, your user account will most likely have no privilege to create new databases on the server. In that case, your CREATE D...
2007-05-10, 4806👍, 0💬

How To Reformat a Paragraph of Text
How To Reformat a Paragraph of Text? - PHP Script Tips - PHP Built-in Functions for Strings You can wordwrap() reformat a paragraph of text by wrapping lines with a fixed length. Here is a PHP script on how to use wordwrap(): &lt;?php $string = "TRADING ON MARGIN POSES ADDITIONAL RISKS AND IS NO...
2007-04-21, 4805👍, 0💬

How To Find a Specific Value in an Array
How To Find a Specific Value in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays There are two functions can be used to test if a value is defined in an array or not: array_search($value, $array) - Returns the first key of the matching value in the array, if found. Otherwise, it retur...
2007-04-20, 4795👍, 0💬

How To Get the Directory Name out of a File Path Name
How To Get the Directory Name out of a File Path Name? - PHP Script Tips - Working with Directoris and Files If you have the full path name of a file, and want to get the directory name portion of the path name, you can use the dirname() function. It breaks the full path name at the last directory p...
2007-04-23, 4793👍, 0💬

How To Query Multiple Tables Jointly
How To Query Multiple Tables Jointly? - PHP Script Tips - Working with MySQL Database If you want to query information stored in multiple tables, you can use the SELECT statement with a WHERE condition to make an inner join. Assuming that you have 3 tables in a forum system: "users" for user profile...
2007-04-19, 4785👍, 0💬

What Is the Scope of a Variable Defined outside a Function
What Is the Scope of a Variable Defined outside a Function? - PHP Script Tips - Creating Your Own Functions A variable defined outside any functions in main script body is called global variable. However, a global variable is not really accessible globally any in the script. The scope of global vari...
2007-04-24, 4782👍, 0💬

How Are Cookies Encoded During Transportation
How Are Cookies Encoded During Transportation? - PHP Script Tips - Understanding and Managing Cookies When cookies are transported from servers to browsers and from browsers back to servers, Cookies values are always encoded using the URL encoding standard to ensure that they are transported accurat...
2007-04-24, 4771👍, 0💬

How To Access MySQL Servers through Firewalls
How To Access MySQL Servers through Firewalls? - MySQL FAQs - PHP Connections and Query Execution If your MySQL server is provided by an Internet service company, connecting to the server from your local machine will not be so easy, because there are firewalls between your local machine and your MyS...
2007-05-10, 4769👍, 0💬

How To Remove a Cookie
How To Remove a Cookie? - PHP Script Tips - Understanding and Managing Cookies Once a cookie is sent from the server to the browser, there is no direct way for the server to ask the browser to remove the cookie. But you can use the setcookie() function to send the same cookie to browser with a negat...
2007-04-24, 4768👍, 0💬

How To Get the Total Number of Values in an Array
How To Get the Total Number of Values in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays You can get the total number of values in an array by using the count() function. Here is a PHP example script: &lt;?php $array = array("PHP", "Perl", "Java"); print_r("Size 1: ".count($array...
2007-04-20, 4767👍, 0💬

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

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