What are headers?
Every time you respond a request, there are some information attached at the beginning of the response. Those are headers. For example:
HTTP/1.1 200 OK
Date: Wed, 08 Feb 2006 08:20:07 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1 mod_ssl/2.0.54 OpenSSL/0.9.7e
Those headers is used to control the browser behaviors such as caching, rendering… If you want to learn more about how to use them, you can see more helps and instructions from here:
Why do I get this warning?
Sometimes, you receive the warnings like this: “… headers already sent by”. It’s also mentioned in that article, but I will summarize the reason here. You got that warning because you call a function like header() or session_start() after sending page content. The page content includes what you sent to browser by echo, print, or whatever outside the server tag <? … ?>. Be caution: the headers must be sent before any other responses.
But actually I did not send any page content before calling header function? Why the warnings are still there?
This is one of the stupid bugs that PHP developers usually get. The page content includes ANY THINGS outside the server tags <? … ?>, that means white spaces and new line characters are also counted as well. Check your code again, maybe you left some blanks after the ending tag ?> in one of your included file.
Ah, one more thing! When you save your files as “UTF-8 with signature” on Windows platforms, 3 bytes with hex code “EFBBBF” will be inserted automatically at the beginning of the files. Those bytes are used to let Windows regconize that the file contains UTF-8 text. They’re unneeded in PHP because PHP won’t treat this signature. It considers those bytes as page content because they appear before the opening tag <?. As the result, any calling to header() and session_start() will be failed. If you’re using Zend Studio, choose the Encoding to “UTF-8 without signature” when saving.
These are some free hosting for you:
??GB free space, unlimited bandwidth, 10MB per file, direct link.
??GB free space, 2GB bandwidth, direct link, FTP, automatic website creation.
1GB free space, unlimited bandwidth, non-direct link.
5GB free space, unlimited bandwidth, non-direct link, embed music player.
unlimited space, 50MB per file, unlimited bandwidth, direct link, music only.
Note: no login needed, but deleted after 90 days without any download.
25GB free space, 10MB per file, 1GB bandwidth, direct link.
You want to develop an application using MSMQ service, but whenever you send or receive message from MSMQ, you receive a Permission Denied exception. A possible reason is that you may have installed MSMQ in workgroup mode.
You can find the resolution for this problem here: http://support.microsoft.com/kb/247394/EN-US/
To use queued components in Workgroup mode, you must do two things:
- To allow for unsigned MSMQ messages, you must set the Authentication Level of the COM+ Application to None.
- To access the queued components from a remote computer, you must specify a queue: moniker that contains the complete FormatName of the destination queue.
To change the Authentication Level of the COM+ Application that hosts the queued components, perform the following steps:
- Under Administrative Tools, open the Component Services MMC snap-in.
- Expand My Computer and browse to the COM+ Application that hosts the queued components.
- To open the property sheet for the application, right-click the application and select Properties. Click the Security tab, and select None for Authentication level for calls.
To add a fade effect to your webpage, you just include this line on the top of your page:
<META http-equiv=Page-Enter content=blendtrans(duration=0.1);>
Unfortunately, it’s supported only by IE.
Some of old PHP application use ANSI SQL to create table and insert data. So when I use those application with UTF8 content in MySQL 5.0, the default character-set of those table is latin1. The problems come when I want to move data to an older MySQL, the encoded content goes wrong.
So this is the solution:
mysqldump -u username –opt –default-character-set=latin1 –skip-set-charset –skip-tz-utc –skip-comments –single-transaction %1 %2 %3 %4 %5
This post will be updated later with full description.
(tác giả: Lê Đình Lĩnh Nam)
Được nghỉ 3 ngày nên ngồi suy ngẫm về cái nghiệp lập trình viên mà mình đang theo đuổi. Continue reading