Posts

Send email by using PHP

if your ISP need SMTP Authentication then you need Pear installed for you php5, and also add one line in your php.ini file: extension=php_gd2.dll require_once "Mail.php"; $from = "Sandra Sender "; $to = "Ramona Recipient "; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "househosting.ca"; $username = "smtp_username"; $password = "smtp_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo(" " . $mail->getMessage() . " "); } else { echo(" Message successfully sent! "); } ?>

Cannot modify header information - headers already sent by

Solution #1 - no output before header(), setcookie() and other header setting functionsThus, the first solution to the "Cannot modify header information" error is to make sure you are not outputting any content at all before the call to the header() function. Solution #2 - ob_start() The second method consists in calling the ob_start() at the very top of the PHP script like this: ob_start(); This will turn output buffering on. With output buffering the entire PHP script will be processed before any output is sent to the client. Thus all the PHP script will be aware of all the header changes and it will not send any headers until every line has been processed.ob_start() may appear to slow down the loading time on server intensive pages, because the client will not be presented with any fragment of the page until the page is fully processed.

How to load data file to mysql

copy xx.sql file to your mysql\bin forlder than login to mysql mysql> source xx.sql;

解决sub 2000 shop 有一些button看不见的问题

很简单,是因为字体被改成了中文的缘故,改成english就好了

FireFox 加速

1. 在 Firefox URL欄內輸入「about:config」 2. 在「Filter」欄內輸入「pipelining」將找到以下三個設定 3. 將 「network.http.pipelining」調為 true 4. 將 「network.http.proxy.pipelining」調為 true 5. 將 「network.http.pipelining.maxrequests」調為 30 6. 最後一步就是在Firefox任何一個地方點右鍵,選擇「新建」—「整數」在彈出的對話框中輸入「nglayout.initialpaint.delay」並將其值改為「0」,表示當瀏覽器收到網站回復的信息後能夠快速的反應。 7. 重新開啟 Firefox 便完成設定

Install IIS 6 + PHP5.2.5 + MySQL in WIN 2003 (PART2)

Today let's lean how to set MySQL. 1. Download MySQL5.0.51a from http://dev.mysql.com/downloads/mysql/5.0.html 2. Unzip it to your C: drive. Then click setup.exe 3. Select "typical" installation.-->standard configuration-->install as windows service-->set new root password (write it down somewhere, otherwise....) 4. Now you can see Mysql in C:\Program Files\MySQL 5. Want access the database? Go to start-->all programs-->MYSQL-->MySQL server 5.0-->MYSQL command line client. 6. Read MYSQL tutorial from this link http://webhelp.ucs.ed.ac.uk/services/mysql/example1-cli.php 7. Add C:\PHP to your path. From the Start menu, right click My Computer and select Properties. From the Advanced tab click the Environment Variables button. Under System Variable find Path and click Edit. At the end of what is already present in Variable Value add a semicolon (;) and then C:\PHP. 8. If you can see it, Then your are success set up MYSQL, simple ! C:\mysql\bin\mysql.exe ...

Install IIS 6 + PHP5.2.5 + MySQL in WIN 2003 (PART1)

Don't know why after I install sharepoint 3, the default web site can not see php file, always ask my password. so I reinstall PHP again. It works for me.... INSTALL PHP 1. Download PHP from http://www.php.net/downloads.php 2. Unzip it to c:\PHP 3. Copy php5ts.dll from c:\PHP to C:\WINDOWS\system32 4. Copy php.ini-dist from c:\PHP to C:\WINDOWS then change the it's name to php.ini 5. Open C:\WINDOWS\php.ini in notepad Change extension_dir = "./" to extension_dir = "C:\PHP\ext" Change ;extension=php_mysql.dll to extension=php_mysql.dll (just delete ";") 6. Open the Internet Information Services (IIS) Manager from start-->Administrative Tools-->local computer-->web sites-->default web site-->right click then select properties-->home directory-->select configration-->under Cache ISAPI extensions click add-->Enter C:\PHP\php5isapi.dll as Executable and .PHP as Extension. Leave the rest as default and click Ok. 7. go to...