Chat room based on PHP (ii)

Now we finally have everything we need to write a new file: Open the file and truncate the file length to 0 $open _file = fopen ("messages.html", "w"); Write header information for a file Fputs ($open _file, $header); A new line (Use stripslashes

Common skills in PHP programming four

PHP Programming Common Skills Four: 1. Configure PHP file directory As a scripting language for server-side interpretation execution, PHP programs are placed in a directory accessible to a server, and can generally be configured by modifying Apache

A good way to upload a file in PHP

P> online very free to support PHP's personal home page space now a lot, then may think of a upload something, but it is free, of course, there will be a lot of restrictions, not allowed to upload, this is normal, some even mail () function is not

A detailed analysis of PHP's Common magic functions

1. __construct ()is invoked when the object is instantiated,When __construct and a function with the class name as the function name exist at the same time, the __construct is invoked and the other is not invoked. 2. __destruct () Called when an

PHP automatically saves remote picture classes

*/Class getromatepic{var $savaDir = ' pic/';var $filePath = ' yun_qi_img/banner.gif ';var $fileName = ' 111cn.net.gif ';function __construct () {$this->isdir ();}function Isdir (){if (!is_dir ($this->savadir)){if (! mkdir ($this->savadir)){Exit ('

PHP removes txt text duplicate data

Because it's13503594262135035942621324369442913503594262138805617501340477699915675167006This format, all of which we use file to load the text directly into the array$array = file ($file); Output with Print_r Array([0] => 13688179054 [1] => 13652

ADODB PHP Database Universal Engine class

1, PHP ADODB address way to connect the database tutorial2, PHP ADODB object way to get the database content3, PHP ADODB HTML code mode display content4, PHP ADODB realize content automatic paging function Include_once ("adodb5/adodb.inc.php

PHP implementation File Download

//author:heaven //File download function download ($file _dir, $file _name) //Parameter description: //file_dir: File directory // file_name: filename {      $file _dir = Chop ($file _dir);//Remove extra space in the path      //Draw the path of

PHP Regular Validation class

/** *php Regular Validation class *code by T.T.R *[url]http://www.gx3.cn[/url] [Url]http://gx3.cn[/url] *qq:252319874 */ Class RegExp { static function Strtrim ($STR) { Return Preg_replace ("/s/", "", $str); } static function UserName ($str,

PHP Paging function

Program Call: $page = multi (total number of records, number of display per page, current page, URL string, maximum number of pages before and after); Stencil call: {$page} Paging function display function multi ($count, $TPP, $page, $url, $maxto =5

Php.net News Intercept!

? Please modify the following variables yourself. $newsnum = 7; $space = 20; $width = 400; $headclass = "CLASS5"; $lowerclass = "CLASS6"; The variable setting ends. Print ""; $opened = $QUERY _string; if ($opened = = "") {$opened = "-1";} Print "www.

PHP Sogou included page number query procedure

For ($i =0 $i $pagecode = @file_get_contents ("Http://www.sogou.com/web?num=1&query=site:". $q);if ($pagecode) {Break}}if ($pagecode) {Preg_match ('/resultbarnum: (. *?) -->/', $pagecode, $sogous);if ($sogous [1]) {$sitesogou = $sogous

PHP generation conforms to Google Map standard XML class sitemap code

MySQL tutorial _connect ("localhost", "root", "root") or Die (' Database Server Uid or Password error! ');mysql_select_db (' IP ') or die (' Data! ');mysql_query ("SET NAMES ' gb2312 '");*/Include ("boke/inc/re_conn.php");$file = ' update.xml ';$url

PHP imports the MSSQL data into the DEDECMS full version

$link = Mssql_connect ("127.0.0.1", "sa", "sa") or Die ("Can ' t connect SQL Server");mssql_select_db ("Cheng", $link) or Die ("Select database Failure");MySQL tutorial _connect (' localhost ', ' root ', ' root ') or Die (' database tutorial server

PHP restricted word single-character expression

? if ($_post){if (funcstr ($_post[' url ')){Echo ' valid character ';}Else (Funccard ($_post[' url ')){Exit (' Please enter the correct username ');}} ?> "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >php restricted word

PHP for beginners php Simple File Upload

php for beginners php Simple File Upload ?$UploadedFile =$_files[' uploadedfile ' [' tmp_name '];$UploadedFile _name=$_files[' uploadedfile ' [' name '];$isTrue =false;if ($UploadedFile){$store _dir=$_server[' Document_root '];$accept _overwrite = 1;

PHP capture Remote Web page images and save to local

Ob_start: Turn on output buffering ReadFile: Reads a file and writes to the output bufferReturns the number of bytes read from the file. If the error returns false and an error message is displayed unless invoked in the form of @readfile ().

Detailed PHP to generate static file optimization technology

Preliminary knowledge Template technology:PHP Template Engine Smarty IntroductionPHP Configuration using Smarty Technology Caching technology: such as constant information, but still need to change the information in the cache to speed up the

PHP Sogou Rating Query procedure

$sourcecode =getsourcecode ("http://www.sogou.com/web?query=". $q);echo ":". $sourcecode;if ($sourcecode) {$sourcecode =iconv (' gb2312 ', ' utf-8 ', $sourcecode);Preg_match ('/Sogou Rating: (. *?) /', $sourcecode, $cmatche);if ($cmatche [1]) {Echo '

PHP Auto Load __autoload () function usage

After PHP5, we can solve this problem by __autoload. And after PHP5.1, Spl_autoload_register () is also provided to provide a more complete loading mechanism. By reading the autoloading in PHP article, I understand the autoload loading mechanism,

Total Pages: 12780 1 .... 9375 9376 9377 9378 9379 .... 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.