Learning PHP Soon, there are a lot of small details on the problem. Recorded here.
Today write a simple user registration and display information on the original page of the applet.
After the local Apach debugging can be displayed normally, but when I put the source on another server, and then access through the domain name can not display the page normally. And the following error occurred:
Parse Error: syntax error, unexpected $end in D:\apache\htdocs\task-1\task-1.php on line 178
The content referred to is simply:
}?>
After inquiry understand, <??> is a PHP short tag that can be turned on or off in the PHP root. ini file to be Short_open_tag set to off/on. for different environment configurations
Vary. <?php?> is a standard PHP tag and is used in any configuration, so it's best to use <?php?>. In addition, there are similar to ASP tag <%%>
Open and close in the. ini file.
Quotation mark problem
$_post["name"] and $_post[name] can be used, but the execution efficiency of $_post["name"] is much faster than $_post[name. Because $_post[name]
During execution, name is used as a constant and only the name constant is not found as the index reference to post. And in some special cases, the $_post[name] will result in a wrong
The result of the error. For example:
There is already a define (' name ', ' value '); In this case, if you use $_post[name] again, it will be treated as $_post["value", causing an error to occur.
Naming issues
Good naming habit can not only greatly increase the readability of the program, but also help us to make mistakes. A good naming system can be more effective for the different modules of the program is better understood by different programmers,
Smoother connections, while also improving efficiency.
PHP short tags, quotation marks, naming problems