We know that Chinese garbled characters are common when Ajax technology is used to interact with the PHP background. JSON is used as a data exchange format similar to XML, when PHP is used for interaction, text garbled characters may also occur. The
One of the biggest advantages of PHP is that it supports new technologies very easily. the scalability of this language allows developers to easily add new modules, in addition, the support of technical groups all over the world and the support of
PHP and HTML
PHP and HTML can interoperate: PHP can generate HTML, while HTML can transmit information to PhP. 1. How can I encode/decode the code when I use a form/URL to transmit values? 2. I am marking with , but the $ Foo. X and $ Foo. Y
SMTP. php
Class SMTP
{
/* Public variables */
VaR $ smtp_port;
VaR $ time_out;
VaR $ host_name;
VaR $ LOG_FILE;
VaR $ relay_host;
VaR $ debug;
VaR $ auth;
VaR $ user;
VaR $ pass;
/* Private variables */VaR $ sock;
/*
// PHP port sniffer-you can specify the website and Port
// Returns the sniffing result
Function http_request ($ server, $ port ){
$ DATA = "";
$ Query = "head/HTTP/1.0 ";
$ Fp = fsockopen ($ server, $ port );
If ($ FP ){
Fputs ($ FP, $ query. "rnn "
The translations saved med are:
CopyCode The Code is as follows: '&' (ampersand) becomes '&'
'"' (Double quote) becomes '" 'when ent_noquotes is not set.
''' (Single quote) becomes ''' only when ent_quotes is set.
''>' (Greater than) becomes '>'
First, the homepage contains a text input and an IFRAME that shows the chat content, and a hidden IFRAME used to submit the form:
CopyCode The Code is as follows: // Chat. php
Header ('cache-control: Private ');
Header ('content-type: text/html;
Because the system performance requirements are very low, we chose link-1, GB hard drive, 64 M memory, GB traffic, and 1 independent IP address.
You can use the discount code 9dmm7r to enjoy a 10% discount, vpslink.com. Of course, you can also find
The php sessions on the web server are all sent to memcached, so that no matter which web server you allocate the ip connection to by the distributor, there will be no problem. The configuration method is very simple, just in the php configuration
There are two common methods for connecting php + access to the database.
Recommended code
Note that php uses realpath to obtain the path.
Copy codeThe Code is as follows: $ Connstr = "DRIVER = {Microsoft Access Driver (*. mdb)}; DBQ =". realpath
If you input a query directly inserted into an SQL statement, the application will be vulnerable to SQL injection. For example:
Copy codeThe Code is as follows: $ unsafe_variable = $ _ POST ['user _ input'];
Mysql_query ("insert into table (column)
Recently, a php memory overflow problem occurs because the temporary file generated during download is too large to accommodate the PHP memory, however, this is only a slow task, so I thought of another method: to read and download files in multiple
In fact, the PayPal payment function has been updating documents and interfaces. Here we talk about a simple payment function. The general process is as follows:
1. On the checkout page of the website, set a form submitted to the PayPal website,
Instructions for use:
// Load the FunctionInclude_once ('phpcodezip. php ');// Create an encrypted file (the directory of the PHP file to be encrypted by sourceDir and the directory of the files encrypted by targetDir)$ Encryption = new PhoCodeZip (
UCHOME code is still very good. Learn it!
Copy codeThe Code is as follows: /**
* Define Constants
*/
@ Define ('in _ UCHOME ', TRUE); // It is said that it can prevent illegal file inclusion
Define ('x _ VER ', '1. 2'); // Uchome version
Define ('x _
During the development process, forms often encounter errors and all information filled in when the page is returned is lost. to support page bounce, you can use either of the following methods. 1. use the header to set the Cache control header
Many friends without a foundation often ask how to open the PHP file. In fact, PHP is a web page script, but unlike the htmlxml label language, it can be opened directly through a browser, you must have a PHP runtime environment to access and open
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