As shown in code 1:
Copy CodeThe code is as follows:
Code 1
Appearance Layer Class
Class Lwordhomepage {
Add message
Public function Append ($newLWord) {
Call the intermediate service layer
$serv = new Lwordservicecore ();
$serv->append ($newLWord);
Sometimes when you use phpMyAdmin, this error message pops up.
"Unable to create the session in the event of an error, check the PHP or Web server logs and properly configure the PHP installation"
I do not know how to cause this error message, and
1.PDO Introduction
PDO (PHP Data Object) is something added to PHP 5, which is a significant feature of PHP 5, since php4/php3 before PHP 5 is a bunch of database extensions to connect and process with each database, what Php_mysql.dll, Php_
This article describes the HTML tags in the PHP empty string
There are two ways to filter all HTML tags in a string: one is to write a function for ourselves, with regular filtering, and one with PHP's own function strip_tags.
Copy CodeThe code is
There are two ways to load PHP automatically.
The first scheme uses __autoload, the function is simpler and weaker.
However, one problem is not solved, that is, before the include to determine the existence of the problem of the file.
Copy CodeThe
Copy CodeThe code is as follows:
function getsubcomments ($parent = 0, $level = 0) {
$db = &jfactory::getdbo ();
$sql = "..."; SQL for querying records
$db->setquery ($sql);
$rows = $db->loadobjectlist ();
$list = Array ();
First get the
At the same time, there are many functions that can be implemented in many ways, which need to be used flexibly. Only remember these functions, in order to develop a dynamic site, but also more practice, the entire site development once, to be
The answer is to make a class--the database class is generated. A very good reuse is achieved through the two-time encapsulation of functions. Include in when you want to use it.
Before speaking the PHP database, first introduce the MySQL point:
Copy CodeThe code is as follows:
/*—————————————————— */
– Recursive deletion of files and directories
– Example: Del_dir ('.. /cache/'); Note: returned/is required
– $type Force Delete directory, true Yes, false no
/*—————————————————— */
function
Default.gif (this image is a template thumbnail) must be a valid template in the directory
Copy CodeThe code is as follows:
function Get_template ()
{
$template = Array ();
$dir = Cms_root. ' /tpl/';
$n = 0;
if (Is_dir ($dir)) {
if ($dh = Opendir ($
A classmate asked a question:
Copy CodeThe code is as follows:
for ($i = ' A '; $i echo $i;
}
What is the output?
The output is:
Abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalamanaoapaqaras .....
Why?
In fact, it is very simple, the PHP
first, what is an array
An array is a set of data that organizes a series of data to form an operational whole. Each entity of an array contains two items: A key and a value.
ii. Statement of data
There are two main ways to declare an array in PHP:
Looking for a long time, found on-line information is very few, so want to write their own, and slowly found that more problems, their own not much of the algorithm, write a calculation of the short point is OK, long hung, and then long I am afraid
The principle of the function is very simple, the main is to use a recursive call.
Copy CodeThe code is as follows:
function File_list ($path) {
if ($handle = Opendir ($path)) {
while (false!== ($file = Readdir ($handle))) {
if ($file! = "." &&
For the security of the website, certainly do not let upload php file, if someone into your backstage, upload a php file, your website source code, all saved into his, directly packaged to see your code. So be sure to control the upload directory
Mysql.class.php Download
Copy CodeThe code is as follows:
Class Mysql {
Private $db _host; Host Address
Private $db _user; User name
Private $db _pass; Connection password
Private $db _name; Name
Private $db _charset; Coding
Private $conn;
Public $
The process of configuring PHP and MySQL is omitted, if under Ubuntu, refer to Ubuntu 10.04 installation Memo.
1. Basic syntax
The way to embed PHP scripts in HTML code is to
Write code in. Output data to the browser using the Echo or print
I am dizzy, recently this use PayPal to pay the function to engage me for 2 days, still not finished. Depressed dead.
Make a note first, write down the part that has been done, save the later forget.
1 Register the Sandbox account, and set up two
Here is the process of logging in to MySQL on Linux, creating a database, and creating a table.
yin@yin-ubuntu10:~$ Mysql-u Root-p
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 360
Server
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service