PHP and Thinkphp simulated message board to deal with XSS attack (super complete!)
XSS attack principle and protection
brief introduction
XSS(Cross Site Scripting) is a common way in Web attacks. Through this attack, users can be controlled to do a series of malicious operations, such as stealing, tampering, adding users' data or inducing to phishing sites.
Attack principle
A common way is to use unfiltered parameters to pass ...
Added by Nothsa on Thu, 28 May 2020 07:50:18 +0300
Eggjs learning notes day 34: eggjs post management login and background permission judgment
1, Login verification. You can't access other pages without login.
Judge whether the user has logged in, and use the middleware in the egg.
New middleware folder under app, new adminauth.js File, type:
var url = require("url");
module.exports = options => {
return async function adminauth(ctx, next) {
// 1. The user does not log ...
Added by Far Cry on Wed, 20 May 2020 18:13:33 +0300
PHP7 production environment queue Beanstalkd correct use posture
Application scenario
Why use it? What's the advantage? This should be put at the beginning to say that only when you know what it is and what it is suitable for, can you better integrate it with your own projects. Where to use it and where to learn it? Learning it doesn't mean learning it doesn't mean we won't. We should usually consider more s ...
Added by arfa on Tue, 19 May 2020 08:46:14 +0300
PHP uses Redis in seven common scenarios
Redis is an open source, network-enabled, memory-based and persistent log, Key-Value database written in the ANSI C language, and provides multilingual API s.
This article focuses on the main scenarios for using Redis with PHP.
Simple String Cache Actual
$redis->connect('127.0.0.1', 6379);
$strCacheKey = 'Test_bihu';
//SET Application ...
Added by chadbobb on Tue, 12 May 2020 09:51:38 +0300
Take a quick look at Nginx
1, Basic knowledge of Nginx
1. What is Nginx?
Nginx is an open source, lightweight, high-performance HTTP server and reverse proxy server.It is characterized by less memory and strong concurrency.
2. What does Nginx do?
It can be used as an HTTP server to access and publish websites.It can also be used as a reverse proxy server to achieve load ...
Added by marian on Thu, 07 May 2020 14:43:36 +0300
De1ctf 2020 web [hard ﹣ pentest ﹣ 1] character free injection & SYSVOL restore group policy password
Open the source code directly, see that it is a file upload, check the file size and pass a Check() function judgment, and take a look at the Check() function
function Check(){
$BlackExts = array("php");
$ext = explode(".", $_FILES["file"]["name"]);
$exts = trim(end($ext));
$file_content = file_get_contents($_FILES["file"]["tmp ...
Added by mrjameer on Thu, 07 May 2020 10:23:40 +0300
Access Control Implementation in Solidity Contracts: Ownable | Roles | AccessControl
OpenZeppelin provides three access control modes for smart contracts: the Ownable contract, the Roles library, and the 3.0 new AccelessControl contract.In this tutorial, we will learn about the differences among the three access control modes and how to use them to enhance the security of Solidity contracts in your own ETAI smart contracts.
Le ...
Added by netfrugal on Wed, 06 May 2020 00:12:49 +0300
Mixed query of tp5+Mongodb and Mysql database
Preface
MongoDB mass data query is fast without data model
Suitable for log database
Or the intermediate database reads and stores some business data to be read from the MySQL database
MongoDB is not suitable for multi table transaction function, and there is not a good determination mechanism for write operation. It is not suitabl ...
Added by steved on Tue, 05 May 2020 01:46:33 +0300
Thinkphp5.0 paging and skipping
In order to improve user experience when there are many pages, you need to add a skip page, that is, manually enter the number of pages to quickly jump to the specified page. Because it's difficult to write pages manually, and you want to use the pages provided by TP5, but the pages provided by TP5 are relatively simple, so you can customize th ...
Added by sweetstuff2003 on Sat, 02 May 2020 10:12:22 +0300
Simple operation of php and mysql
mysql is a fast, reliable and easy-to-use database system running on the server, which is often combined with php for web development.
There are two ways for php to connect to mysql:
mysql i ('i 'means improved): only for mysql
pdo (php data objects): can be used in many databases
mysqli connection mode can be divide ...
Added by hightechredneck on Sat, 02 May 2020 00:52:55 +0300