Advanced application of PHP objects
1. Advanced application of PHP objects
final keyword Final means "final" and "final"; The classes and methods modified by final are the "final version"; If there is a method, the format is:
final class class name{
//...
}
Indicates that this class is no longer inherited and cannot have subclasses; If there ...
Posted by HuggieBear on Sat, 04 Dec 2021 11:10:40 -0800
php+mysql to achieve a simple library management system
php+mysql to achieve a simple library management system
ps: the front-end page design is a little ugly. I'll make do with it. Ha ha ha. It does not have user and administrator functions. If you want to realize it, you only need to selectively use the function of the home page according to the account information in the database. Database relat ...
Posted by leena86 on Fri, 03 Dec 2021 14:26:06 -0800
Recurrence and analysis of yii2 deserialization vulnerability
Environment construction
The vulnerability is in the version before yii2.0.38. Download version 2.0.37basic
https://github.com/yiisoft/yii2/releases/tag/2.0.37
Modify the value of the / config/web file
Enter php yii serve in the current directory to start
Reappearance
Construct the deserialization entry first
Create a new contro ...
Posted by claypots on Mon, 29 Nov 2021 07:48:07 -0800
Creation of di php container
Let's first determine the most basic functions of the container. First, the container needs to be able to store and extract objects.The objects in the container can be managed uniformly in an array. The class name can be used as the key, the object as the value, and the object can be stored in the array.When extracting an object, you only need ...
Posted by bender on Sun, 28 Nov 2021 09:11:34 -0800
CTFshow question brushing Diary - WEB - file upload
web151 front bypass
Simply change exts:png to php on the front end
exts:'php'
visit
/upload/shell.php?shell=system("tac ../flag.php");
Web152 content type bypass
Instead of changing the front end this time, change the content type directly in bp to image/png
Summarize the common content type types
Common media format types are ...
Posted by RosieisSweet on Tue, 23 Nov 2021 14:34:21 -0800
PHP security and vulnerabilities to prevent SQL injection
What is SQL injection
The first is the security vulnerability in the database layer of the Web program, which is the simplest vulnerability in the website.The main reason is that the program does not judge the legitimacy of the user input data, so that the attacker can add additional SQL statements to the pre-defined SQL statements in the Web ...
Posted by vund0 on Tue, 23 Nov 2021 03:10:06 -0800
[loophole recurrence] any user at the front desk of Zhimeng CMS modifies the password
1 reproduction environment
PHP 5.6 Decmsv5.7sp2 official version (January 9, 2018)
Reproduction process
According to gourd painting ladle, water a blog. First download the source code of this version, and then unzip it. See the construction process for details This article After the installation, I can't directly access the home page anyway. ...
Posted by imperium2335 on Mon, 22 Nov 2021 21:51:36 -0800
A thinkphp package that can easily generate CSV files from Eloquent models.
composer require whereof/think-csv
$users = User::select(); // All users
$csvExporter = new \whereof\think\csv\Export();
$csvExporter->build($users, ['email', 'name'])->download();
Create CSV
$exporter - > build ($modelcollection, $fields) requires three parameters. The first is the model (a collection of models), the second is t ...
Posted by ckdoublenecks on Sat, 20 Nov 2021 18:43:41 -0800
Example of PHP operating Redis queue
IDS is an advanced open source key value storage system, which is implemented in ANSI C. It is similar to memcached, but supports persistent data storage
Queue operation:
<?php
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
while(True){
try{
$value = 'value_'.date('Y-m-d H:i:s');
$redis->LPUSH('key1',$value);
sleep(r ...
Posted by dazzathedrummer on Sat, 20 Nov 2021 01:40:39 -0800
laravel implementation order list
First, you need to create an order table
Create the database migration file when creating the model
php artisan make:model Order -m
Perfect database fields
public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->integer('user_id')->comment('User placin ...
Posted by sabatier on Sat, 20 Nov 2021 00:01:59 -0800