FAQ about PhP in smth

Source: Internet
Author: User
Q. Why is Chinese content not displayed in the browser when the Apache server is used?
A. The new version of Apache (2.0.x or later) sets the default language of the server to the Western European language.
This situation. The solution is to modify httpd. conf and find "adddefaultcharset ",
Change this row:
Adddefacharcharset gb2312
Then restart the Apache server.
TIPS: httpd. conf location: in Linux, it is located in/etc/httpd or/usr/local/apache2/CONF,
Windows is located under the conf directory of the installation directory.
After the browser browses the page of the western European language, it will remember the language settings of the page, so
Sometimes, even if you modify the server settings, the default language displayed in the browser is the Western European language.
In this case, you only need to clear the browser's history and cache.


Q. Why can't PHP obtain the submitted content after a form is submitted on the webpage?
A. The new PHP version has abandoned the original form content processing method, that is, the submitted Form Content is no longer directly
Copy to a variable with the same name. There are four solutions:
1. Modify PHP. ini, search for register_globals, and change its value to on. In this way
For example, if the submitted form contains a variable named "username ",
You can directly use $ username to access the variable. However, unless you want to use an old piece of code
This method is not recommended because of compatibility issues.
2. Use the $ http_get_vars and $ http_post_vars Arrays for access. For example, write
$ Http_post_vars ["username"] format. However, this method is not recommended.
3. (recommended) use $ _ post, $ _ Get and other Arrays for access, for example, written as $ _ post ["username "]
Format. This method is recommended.
4. (recommended) use the import_request_variables function. This function imports the submitted content to change
. For example, import_request_variables ("GP", "rvar _");
You can select g, P, and C as the first parameter to import get, post, and COOKIE variables.
Prefix of the imported variable. After executing the preceding statement, you can use $ rvar_username to access and submit
Username variable.
TIPS: the default variables mentioned in Item 3 are: $ globals, $ _ server, $ _ Get, $ _ post, $ _ cookie,
$ _ Files, $ _ ENV, $ _ Request, $ _ session, etc. For more information, see the PHP manual.

Q. Why is session unavailable in Windows + Apache + PhP?
A. php saves the session to a directory on the server. Because PHP was originally designed for UNIX
The default directory is/tmp. Therefore, when using session in Windows, you need to change the directory
Directory.
The modification method is: Open the php. ini file, find the variable session. save_path, and set its value
(/Tmp by default) modify the directory that exists on your computer, for example, C: \ winnt \ temp.

Q. Please recommend some useful forum programs and download methods.
A. ASP environment: dynamic network forum (dvbbs)
PHP environment: vBB Forum, phpBB Forum, usually requiring MySQL Database Support
Perl environment: lb5000 Forum, no database support required
For the download method, go to www.google.com or another search engine and use the forum name as a keyword.

Q. How to paste an attachment?
A.1. attachments can be pasted when a document is published on the Web,
2. Use the term tool with the zmodem function to press the U key and select a file when entering the title of a document.
The new version of fterm and so on can, see the http://www.smth.edu.cn
TIPS: up to 3 attachments & less than 2 MB. If your attachments exceed this limit, upload them in batches.
Do not edit the document after the attachment is uploaded; otherwise, the file address will be overwritten (you can delete and resend the file by yourself)
The attachment upload function is used to facilitate layout discussions. You are not allowed to upload illegal or invalid files. Pay attention to anti-virus before uploading.
The sender of the uploaded file is obligated to clarify its purpose. The attacker can delete or ban the permission to send a document based on the actual circumstances.

Q. How to download attachments
A.1. when using web browsing, you can click the attachment link to download
2. Use the zmodem function of term to download. For more information, see the description of related terms.

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.