Header usage
The Header () function sends an original HTTP header [HTTP header] to the client.The header is the string sent by the server before the server passes HTML data to the browser with HTTP co-meaning.Separate HTML files with a blank line.
Page: The current pages, that is, as long as the other pages are not valid, can be approximated to understand the Java this objectRequest: A session, a simple understanding is the scope of a request is valid, for example, if the forward way to jump,
[HTML] The reason why is garbled is clearly added, charsetutf8
To put it bluntly, the right key creates a new text file, and changes the new text file .txt to "1.html ",
Then write in it:
Chinese
There is no problem at all,
However,
Introduction to UTF-8 CodingUTF-8 coding is a widely used code, which is committed to incorporating global languages into a unified code and has already incorporated several Asian languages. UTF stands for the ucstransformation format.
The UTF-8
Phpoutputbuffering cache and program cache. If the following test is performed before the test to make the test more effective, we will output the following code in Output_bufferingoffDisplay_errorson php (content-type: texthtml; charsetutf-8ok;
In
You can use the custom exception handler to handle all uncaught exceptions (exceptions that are not caught with Try/catch).Set_exception_handler (): Sets a user-defined exception handler that, when an uncaught exception occurs, the name of the
Web applications must meet the needs of multiple languages. Users in different countries should be able to enter characters in their own languages, and Web applications should be able to display pages in multiple languages according to different
Summary of several ways to obtain json data from the server based on the $. ajax () method,. ajaxjson
1. What is json
Json is a data structure that replaces xml. Compared with xml, json is more compact but has a strong descriptive capability, and
Data modification of the view, also modified in the tableReference tool class with "java.util.Date" %>" Java.text.SimpleDateFormat" %>The introduction package can be written in a single piece, or it can be separated by commas in a single line.""
In PHP, the Curl function has a set of related functions, it is a very good function, we often use it to imitate a variety of login and collection work, let me introduce you to the Curl function get started.
About Curl
Curl is a tool that uses URL
CURL introductionCURL is a tool that uses the URL syntax to transmit data and files. It supports many protocols, such as HTTP, FTP, and TELNET. PHP also supports the cURL Library.If we want to obtain the content of a webpage, we may use the
In
If
Test
Before the test, to make the test more effective, we
Output_buffering = off
Display_errors = on
Code
"php" ("content-type:text/html;charset='utf-8'" 'ok';
The
PhpWarning: Cannot modify header information-headers already sent
Why can I ask a question if CURL capture fails ~
The data on this page cannot be captured using curl ~ How can this problem be solved?
Http://mybus.xiamentd.com/LineDetailQuery? LineId = 118 & direction = 1
Thx!
Reply to discussion
The following tests the OB cache and the program cache:Before testing, we turned off the OB cache and set an obvious error level in the php.ini to test the results more clearly.
Output_buffering=offDisplay_errors=on
Code 1:
Copy Code code as
In php, the outputbuffering cache (php's own cache mechanism) is provided to control the output display sequence of the program ). If the Ob cache is enabled, the output must first be stored in the ob cache and then stored in the program cache. If
Phpoutputbuffering cache and program cache for in-depth resolution. Next we will test ob cache and program cache: to make the test more effective, we will first disable ob cache and set an obvious error level in php. ini.
1. function file (' target file ')
Read the file in the form of an array and iterate through the array output in a circular way.
1.
2. Header (' content-type:text/html; Charset=utf-8 ');
3. $file =file ("test.txt");
4. if ($file)
5. {
6. foreach
Ask a question, ha ~
Use Curl to crawl the data on this page ~ Ask the method
Http://mybus.xiamentd.com/LineDetailQuery?lineId=118&direction=1
Thx!
Reply to discussion (solution)
Adjust your program based on the return head
$url = '
Foreword: Recently, when writing a Java Web background, I adopted the Spring+mybatis+mysql method. Record the key issues that are encounteredinterface returns data-relatedreturn null after using @responsebody Description: just run the background,
The Web server receives the HTTP request from the client and creates a response object for each request that represents the requested request object and represents the response.
1. To get the data submitted by the client, just need to find the
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.