Q & A for beginners of PHP (2)

Question 1: Why does "APACHE. EXE: cannot determine local host name." appear ."?Answer 1:Because ServerName is not specified by default for Apache in Windows, an error occurs during running.The solution is to modify httpd. conf In the conf directory

Generation of the message book of the 3rd empire

// Display all messages$ Conn = mysql_connect ("hostname", "username", "password"); $ db = mysql_select_db ("dbname", $ conn); $ numcolumns = 8; // number of records displayed on each page$ Query = "select * from guestbook"; $ result = mysql_query ($

Using DBSQL to speed up MySQL database development

When writing a database program to access MYSQL, do you feel very troublesome: a large set of functions and parameters, and check the call results, the biggest headache is that every program should contain the database name, user, password, and so

Customize the 404 error page and send it to the Administrator Program

If your user cannot find the page he wants, how can he give him a friendly reply and you know that this error has occurred? Look at the following program, is used to customize the 404 error page and send notifications to the network management. ---

Challenge the source code of the best message book (3)

Action. php fileRequire ('config. php ');$ Action = $ arr_request ['action'];$ Key_liuyan = $ arr_request ['key _ liuyan '];If (! Isset ($ PHP_AUTH_USER )){Header ('www-Authenticate: Basic realm = "manage messages "');Header ('HTTP/1.0 401

Source code of my Forum (III)

Displays the topic content page. Fox Network Forum Include "linkfox. inc. php ";Include "info. inc. php ";?>$ Query = "select * from foxbbs where id = '". $ id. "'"; // This ID is uploaded from the previous page, that is, FOXBBS. PHP.$ Req =

Php Data Structure and algorithm (PHP description) Search and Binary Search

Copy codeThe Code is as follows:/*** Search***/// Sequential searchFunction normal_search ($ arrData, $ val ){$ Len = count ($ arrData );If ($ len = 0) return-1;For ($ I = 0; $ I Echo "find No.", $ I + 1, "value =", $ arrData [$ I], "is =", $ val ,"?

Openflashchart 2.0 simple case php

1. openflashchart is a more practical icon rendering plug-in, and is open source, web site http://teethgrinder.co.uk/open-flash-chart/2. FlashChart classCopy codeThe Code is as follows:FlashChart Class CodeClass FlashChart{Private $ id;Private $

PHP number_format () function definition and usage

The number_format () function uses a thousand-bit grouping to format numbers.Syntax Number_format (number, decimals, decimalpoint, separator) Parameters Description Number Required. The number to be formatted.If no other

Php security: GET the value directly with $ instead of the $ _ GET character escape

Copy codeThe Code is as follows:Function my_addslashes ($ string, $ force = 0 ){! Defined ('Magic _ QUOTES_GPC ') & define ('Magic _ QUOTES_GPC', get_magic_quotes_gpc ());If (! MAGIC_QUOTES_GPC | $ force ){If (is_array ($ string )){Foreach ($ string

Several useful php string filtering and Conversion Function Code

Nl2br (); // \ nAddslashes (); stripslashes (); // escape special characters when operating on the databaseChop (); // remove the right space of the stringTrim (); // remove all spaces in the stringLtrim (); // remove the left space of the

The session cannot be created when an error occurs. Check the PHP or website server logs and correctly configure PHP installation (win + linux)

Solution in windows:Find the path of session. save_path = "" in php. ini and check whether this directory exists or whether the directory has write permissions for everyone or Authenticated Users. GenerallySolution in linux:After updating PHP today,

Simplehtmldom Doc api help document

API Reference Helper functionsObject str_get_html (string $ content) Creates a DOM object from a string.Object file_get_html (string $ filename) Creates a DOM object from a file or a URL.DOM methods & propertiesStringplaintext Returns the contents

Differences between obfuscated functions such as echo (), print (), require (), and include () in php

1. Differences between echo and printThe echo and print functions in PHP are basically the same (output), but there are still slight differences between the two. No return value after echo output, but print has a return value. If the execution fails,

PHP tutorial-how to use shell scripts in PHP

As a command language, it interactively interprets and executes user-entered commands or automatically interprets and executes a series of pre-defined commands. As a programming language, it defines various variables and parameters, it also provides

Description of whether the MySQL time field uses INT or DateTime

When parsing DEDECMS today, we found that deder's MYSQL time fields are all used 'Senddata' int (10) unsigned not null default '0 '; Later, I found this article on the Internet. It seems that if the time field is involved in the

Solution to php exec command failure on the server

This article focuses on the windows php environment, and the linux system is not in the scope of discussion. For security reasons, the server does not allow php or other languages to execute the exec command. When you have special requirements for

Summary of several PHP Vulnerabilities

Several PHP vulnerabilities that need attentionSeveral important php. ini optionsRegister GlobalsPhp> = 4.2.0, php. the default value of the register_globals option of ini is Off. When register_globals is set to On, the program can receive various

PHP summarizes the methods for generating HTML pure static Web pages for the entire website

Copy codeThe Code is as follows:// Add ob_start () to your start ();Ob_start ();// The following is your code// Add ob_end_clean () to the end and output this page to a variable.$ Temp = ob_get_contents ();Ob_end_clean ();// Write a file$ Fp = fopen

PHP code for collecting Tencent Weibo

Copy codeThe Code is as follows:Header ("Content-type: text/html; charset = UTF-8 ");$ Weibo = file_get_contents ('HTTP: // t.qq.com/starank ');$ Preg = '/ (. *) /Uis ';Preg_match_all ($ preg, $ weibo, $ string );Foreach ($ string [1] as $ key => $

Total Pages: 12780 1 .... 10240 10241 10242 10243 10244 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.