Use JS to implement ajax,php upload image after successful return to the path of the picture (pop-up window).
The effect is as follows:
1. Upload interface:
2, after the successful upload
3. Files received in the background
The code is simple:
1,
Render
1. Do not specify render
Result: (current models is within Controller)/(current Controller)/(current action). phtml
2. $this->render (' xxx ');
Result: (current models is within Controller)/(current controller)/xxx.phtml
3. Summary
Render
PHP Execution Process
The source code computer in any language has no way to execute directly, and it needs to be converted into machine instructions that the computer can recognize.
PHP is also a high-level language and needs to be compiled
This article transferred from: http://www.07net01.com/2016/01/1121802.html
The previous time PHP upgraded to 7.0 version, it is said to be a cow fork, such as performance compared to 5.6 increase twice times, memory consumption, and so on, and then
Note: This series of posts uses the symfony2.7.* framework.
Doctrine
Doctrine2 as a database persistence framework for PHP, it is very popular in foreign countries, in the current PHP field, doctrine is one of the best persistence framework, the
This method is placed at the bottom of the includes/lib_base.php./*** Method of acquiring city according to IP* @param type $IP IP address* @return boolean|string**/function Getiplookup ($ip = ") {if (empty ($ip)) {Return ' Please enter the IP
Problem
Cron periodically triggers a task, but it is never executed, and /var/log/cron there is no corresponding log generation in it, and there is no error log under the PHP-FPM log file.
Analysis && resolution
Cron not executed?
Does not:
slowly update, a little accumulation, are their own problems encountered in the use of
Setting:(2016.4.15)
1: note Template, Phpstorm has a very powerful comment template, can change at any time according to their own needs, and set shortcut keys,
Today with the Curl_init function crawl Sohu Web page, found the collection of Web pages garbled, after analysis found that the original server opened gzip compression function. Just add multiple options to the function curl_setopt curlopt_encoding
Data-id= "1190000004892254" >
Name space
Declaration of the namespace
namespace at the top of the PHP file,
A namespace declaration statement begins with namespace, followed by a space, followed by the name of the namespace, ending
True static caching: (really generates an HTML page that calls the HTML directly in the next operation)
The first time (refresh the Web page) to determine if there is a cache file (can be set one time)
If there is no first time is (can be based on
This article for you to share in detail the construction of the thinkphp framework encountered problems, for everyone to provide a solution, the specific content as follows
The first part: frame construction
I was just in touch with thinkphp, so I
1. Modify PHP.ini to save Extension=php_mssql.dll's comments.
Modify Php.in to change mssql.secure_connection = off to Mssql.secure_connection = on.
2. Download the connection 2005 Ntwdblib.dll (2000.80.194.0)
Click to download
3. Open the
Views in the Thinkphp
1. Template annotations
In the actual project development, the annotation function is often used, and if it is a thinkphp framework, it can be commented in the template file as follows:
{//comment content}: single-line comment
Sometimes we need to use PHP to get a picture of the page and save it, here we can use Preg_match_all to match the image address, the need for code farmers can refer to the next
Preg_match_all function:int Preg_match_all (string pattern, string
Recently there is a requirement to batch update a few fields in a database table, and in doing so, PDO is used to do parameter binding, in which a pit is encountered.
Solution Selection
The author has known to do batch update has the following
fsocketopen/curl/file_get_contents contrast
fsocketopen
is a lower-level call, a socket call that belongs to the network system
1, Fsockopen returns data that has not been processed, including the length of the
1, file_get_contents
Get the data in a get way
$url = ' blog.csdn.net/guugle2010 '; $html = file_get_contents ($url); Echo $html;
Get data by post
$data = Array ( ' name ' = ' guugle ', ' blog ' = '
using the Uniq command, you can filter out duplicate lines in a text file, statistics, and so on, and it also accepts input from the pipeline. With awk, you can even manipulate columns in rows, such as counting the number of independent IPs in Nginx
Sometimes the template definition needs to write a long full path class name, here is a simple alias calling code to circumvent this problem, the disadvantage is that the IDE code hints function is not
*//Initialize * Zgfacade::setzgfacade (' form '
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