• Thinkphpp5 inserts images via Ajax and displays them in real time (full code)


    Single picture upload Display: Complete code: <!DOCTYPE html> <html> <head> <meta charset=”utf-8″> < title > Ajax upload image practice <script src=”http://libs.baidu.com/jquery/1.9.0/jquery.js”></script> <style type=”text/css”> </style> </head> <body> <form> < label for = “exampleinputmail1″ > front of ID card < / label > <input type=”file” name=”drawing” onchange=”picture(this);” /> <! — the path to upload the image — […]

  • Analysis of tp3.2 paging in TP5 framework


    This paper gives an example of how to use tp3.2 paging in TP5 framework. To share with you for your reference, as follows: Tp3.2 paging in TP5 Because there are too many pits on Baidu, I took them to change them Here’s what works First, copy the page of tp3.2, take it to the org […]

  • Tp5 (ThinkPHP5 Framework) An Example of Batch Delete Function Using DB


    This paper illustrates how TP5 (ThinkPHP5 framework) uses DB to implement batch deletion. Share for your reference, as follows: 1-Front-end Page html <a href=”javascript:;” rel=”external nofollow” onclick=”datadel()”> <i></i>Batch deletion</a> <td><input type=”checkbox” value=”{$category.id}” name=”id”></td> js function datadel(obj){ Layer. confirm (‘confirm to delete in batches? ‘, function (index){ var id=new Array(); $(‘input[name=”id”]:checked’).each(function(){ ID. push ($(this). val ();// […]

  • Tp5 (ThinkPHP5 Framework) Captcha Verification Code Configuration and Examples of Verification Operations


    This paper illustrates the configuration and operation of captcha verification code of TP5 (thinkPHP5 framework). Share for your reference, as follows: 1- installation composer require topthink/think-captcha 1.* -vvv 2 – Configuration file ‘captcha’=> [//Verification Code Character Set 3. ‘codeSet’=>’2345678 ABC defhijkmnpqrstuvwxyz ABCDEFGHJKLMNPQRTUVWXY’, //Verification Code Font Size (px) 5. ‘fontSize’=> 28, // / Whether to draw […]

  • Case Analysis of Time Query Operation in TP5 (ThinkPHP5 Framework)


    This paper illustrates the time query operation of TP5 (ThinkPHP5 framework). Share for your reference, as follows: Cross-month queries may be encountered in projects For example, when you enter 201809, you get the start time of the month, $start_month, and the end time, $end_month. The September 2018 data will be queried, but when one of […]

  • TP5 (ThinkPHP Framework) Implementation of Background Clearance Cache Function Example


    This paper illustrates how TP5 (ThinkPHP framework) implements background cache clearance. Share for your reference, as follows: Lalayui plug-in http://www.layui.com/ 1 — Common files /** * Cyclic deletion of directories and files * @param string $dir_name * @return bool */ function delete_dir_file($dir_name) { $result = false; if(is_dir($dir_name)){ if ($handle = opendir($dir_name)) { while (false !== […]

  • TP5 (ThinkPHP5 Framework) Single Map Upload Plug-in Usage Example Based on Bootstrap


    This paper illustrates the usage of TP5 (ThinkPHP5 framework) single-map upload plug-in based on bootstrap. Share for your reference, as follows: 1 – Introduce JS file and CSS file <! – Picture upload – > <link href=”/public/static/css/bootstrap.min.css” rel=”external nofollow” rel=”stylesheet”> <link href=”/public/static/css/fileinput.css” rel=”external nofollow” media=”all” rel=”stylesheet” type=”text/css” /> <script src=”/public/static/js/jquery-2.0.3.min.js”></script> <script src=”/public/static/js/fileinput.js” type=”text/javascript”></script> <script src=”/public/static/js/fileinput_locale_de.js” […]

  • TP5 (ThinkPHP5 Framework) Implementation of Displaying Error Information and Line Number Function


    This paper illustrates the method of displaying error information and line number in TP5 (ThinkPHP5 framework). Share for your reference, as follows: In the process of program debugging, if you want to debug and display detailed error information, you need to modify it.application\config.php There are two settings in the file:show_error_msgValuefalseChange totrue // Display error message […]

  • Example of TP5 (ThinkPHP5) Framework Connecting to Database


    This paper illustrates the method of connecting ThinkPHP5 framework to database. Share for your reference, as follows: 1. Configuration file directory tp5\application\database.php Connect through the configuration file. You can also link through methods In the controller, the method links the database; there is a slight difference between the method of writing queries and the method […]