CakePHP?? ?????? ??? ?? ????. ?? ???? CRUD(??, ??, ????, ??) ??? ???????.
?? config/app_local.php ??
?? ??????? ???? ???.'Datasources' => [ 'default' => [ 'host' => 'localhost', 'username' => 'my_app', 'password' => 'secret', 'database' => 'my_app', 'url' => env('DATABASE_URL', null), ], /* * The test connection is used during the test suite. */ 'test' => [ 'host' => 'localhost', //'port' => 'non_standard_port_number', 'username' => 'my_app', 'password' => 'secret', 'database' => 'test_myapp', //'schema' => 'myapp', ], ],
?? ?? ?? ??? ??? ????. ?
'host' => 'localhost', 'username' => 'my_app', 'password' => 'secret', 'database' => 'my_app',
???, ??? ??, ????, ?????? ? ?? ??? ??? ?? ??? ? ????.
???? Datasources ??? config/app_local.php?? ???????? ?????.
?? ?? ?? ??? ?? ???? phpmyadmin ?? mysql ??????? ???? ??? ?? my_app ???? ?????. ?

? ??? ??? ???? ??? ???. ?? app_local.php? ??? ??? ?? ?????? ?? ??? ????. CakePHP ????? ????? ?? ??? ???? -

?? ??????? ??? ?? ??? ???? ???????.
CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
?? ??
??????? ???? ????? ?? TableRegistry ???? ???? ???? ???? ???. get() ???? ???? ??????? ????? ??? ? ????. get() ???? ?????? ???? ??? ??? ?????.
? ? ????? ? ???? ??? ? ?????. ? ???? ????? ??? ?? ?????. ?? ??????? ? ???? ??? TableRegistry ???? ????? ?? save() ???? ???? ???.
?
?? ????? ?? config/routes.php ??? ?????.
config/routes.php
<?php use Cake\Http\Middleware\CsrfProtectionMiddleware; use Cake\Routing\Route\DashedRoute; use Cake\Routing\RouteBuilder; $routes->setRouteClass(DashedRoute::class); $routes->scope('/', function (RouteBuilder $builder) { $builder->registerMiddleware('csrf', new CsrfProtectionMiddleware([ 'httpOnly' => true, ])); $builder->applyMiddleware('csrf'); //$builder->connect('/pages',['controller'=>'Pages','action'=>'display', 'home']); $builder->connect('/users/add', ['controller' => 'Users', 'action' => 'add']); $builder->fallbacks(); });
src/Controller/UsersController.php?? UsersController.php ??? ?????. ???? ??? ?? ??? ?????.
src/controller/UsersController.php
<?php namespace App\Controller; use App\Controller\AppController; use Cake\ORM\TableRegistry; use Cake\Datasource\ConnectionManager; use Cake\Auth\DefaultPasswordHasher; class UsersController extends AppController{ public function add(){ if($this->request->is('post')){ $username = $this->request->getData('username'); $hashPswdObj = new DefaultPasswordHasher; $password = $hashPswdObj->hash($this->request->getData('password')); $users_table = TableRegistry::get('users'); $users = $users_table->newEntity($this->request->getData()); $users->username = $username; $users->password = $password; $this->set('users', $users); if($users_table->save($users)) echo "User is added."; } } } ?>
src/Template? Users ????? ??? ?? ???? ??? add.php?? View ??? ????. ?? ??? ?? ??? ?????.
src/Template/Users/add.php
<?php echo $this->Form->create(NULL,array('url'=>'/users/add')); echo $this->Form->control('username'); echo $this->Form->control('password'); echo $this->Form->button('Submit'); echo $this->Form->end(); ?>
?? URL? ???? ?? ??? ??? ???. http://localhost/cakephp4/users/add
??
???? ??? ?? ??? ?????.

??? ?? ??? ???? ???? ?????. ?

? ??? CakePHP ?????? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP?? ?? ?? ??? ???? ?? ??? ? ???? ?? ??? ???? ?? ??? ???? ???? ????. 1. ?? ?? ??? ?? ??? URL ? ?? ??? ????. 2. UrlenCode? ???? ?? ??? ???????. 3. ? ???? ????? ?? ?? ??? ? ?? ??? ?????. 4. ???? ???? ?? ? ? ??? ??? ??? ??? ?????. 5. ??? ?? ??? ????? ?? ????? OG ??? ???? ?????. 6. XSS ??? ???? ?? ??? ??? ?????. ? ???? ??? ??? ???? ??? ?? ?? ??? ??? ???? ??? ?? ??? ?????.

AI? ??? ??? ?? ?? ? ?? ???? ????? ?? ??? ??????. 1. Baidu, Tencent API ?? ?? ?? NLP ?????? ?? ??? AI ?? ?? API? ??????. 2. PHP? ? ?? guzzle? ?? API? ???? ?? ??? ??????. 3. ?? ????? ?? ?? ??? ???? ???? ???? ??? ??? ? ????. 4. ?? ?? ? ?? ???? ?? PHP-L ? PHP_CODESNIFFER? ??????. 5. ???? ????? ???? ?? ?? ??? ?????? ??? ??????. AIAPI? ??? ? ???, ?? ??, ?? ? PHP ?? ??? ??? ???. ?? ???? PSR ??? ???, ??? ????? ????, ?? ??? ???, ????? ??? ????, X? ???????.

1. ?? ???? ??? ??? ?????? ?? ?? ??? ??, ??? ?? ???? ??? (? : ?? ???, ? ? ??), ?? ??? ?? ???? ???? ? ?? ?? ??? ??? ?? ??? ????????. 2. ?? ??? ??? ?? ? ??? ???? ?? ?? ?? ???? ?? ? ?? AUDIT ?? ??? ??? ? ????? ????? ??? ???????. 3. ?? ?? ??? ?? ??? ???????. Recaptchav3 ???? ??, ??? ?? ?? ?? ?? ??, IP ? ?? ??? ??? ??? ?? ???? ??? ?? ??? ????? ??? ???? ????? ??? ?????.

??? ?? ??? ??? ?? JavaScript? MediareCorder API? ?? PHP ???? ???? ?????. 2. PHP? ???? ?? ??? ???? STTAPI (? : Google ?? Baidu ?? ??)? ???? ???? ?????. 3. PHP? ???? AI ??? (? : OpenAigpt)? ????. 4. ?? ?? PHP? TTSAPI (? : Baidu ?? Google ?? ??)? ???? ??? ?? ??? ?????. 5. PHP? ?? ??? ??? ??? ??? ?? ?? ??? ?????. ?? ????? PHP? ?? ???? ?? ?? ?? ??? ??? ?????.

AI ??? ?? ??? PHP ??????? ???? ?? ????? ??? ???, ?? ???, JSON ?? ?? ? ?? ?? ? ??????? ?? ??? ???? ?? AI ??? ??? API? ???? ????. 2. ?? ??? ??? ???? ?? ????? ??? ?? ?? ?? ??? ?? ? ?? ??? ????? "Dead Data"?? "Live Data"? ??? ???? ??? ? ????. 3. AI ???? ????? ??? ??, ???, ??, ?? ???, ?? ?? ? ??? ?? ??? ?????? ??? ? ??? ???? Google CloudVision? ?? ?? ????? ???? ?? ????. 4. ???? ???? ???? ?? ??, ?? ??, ?? ??, ??? ?? ??, ?? ??, ??? ?? ?? ?? ? AI ?? ??? ??? ?????.

PHP? ?????? ????? ?? ?? ?? ???? ???? ?? ???? ???? ?? ?? ???? ?????. 2. ?? ??? ???? ???? ?? ??? ?? ? ??? ??? ???? ?? API/Webhook ??? ??? ?? ???? ??? ??? ??? ??? ?????. 3. ?? ????? ?? ??, ??/???? ????, ???? ??, ???? ? ??? ?????? ????? ?? ??? ???? ???? ?? Dingtalk, SMS ?? ??? ???? ??? ?????? ???? ?? ? ??? ??? ????? ?? ??? ???? ???????.

PHP? AI ??? ??? ?? ????? ??? API? ?? ?????. ??? ??? ????? ? ??? ???? ?????. API ??? ?? ?? ??? ???? ??? ??? ???? ???? ? ????. 2. ?? ?? ???? guzzle ?? curl? ???? HTTP ??? ???, JSON ??? ??? ? ???, API ? ?? ??, ??? ? ?? ??? ???? ??, ??? ?? ?? ? ? ?? ????, ??? ?? ? ?????? ?????. 3. ???? ???? ?? ???? API ??, ?? ? ??? ?? ??, ??? ?? ??, ?? ?? ? ??? ??? ??? ?????. ?? ??? ??? ??? ? ??? ???? Propt ?? ? ?? ?? ??, ??? ?? ? ?? ????, ?? ?? ?? ???? ? ??? ?? ? ???? ????? ?????.

PHP? ??? ??? (? : ???? ??, ??? ??) ? ?? ??? ???? AI ??? ?? ?? ??? ?????. 2. CURL ?? GRPC? ???? AI ??? ???? ??? ? ??? ?? ??? ?????. 3. ??? ?? ?? ?? ??, ?? ??? ? ?? ??? ???? ?????. 4. A/B ? ??? ???? ?? ?? ?? ??? ????? ?? ??? ???? ??? ??????. 5. PHP? ???? ??? ?? ? ??? ??? ?????? Googleads? ?? ?? API? ???? ?? ?? ? ???? ??? ???? ???? ????? CTR ? CVR? ???? CPC? ??? AI ?? ?? ???? ?? ??? ??? ?????.
