if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)
echo "failed to create socket: ".socket_strerror($sock)."n";
if(($ret = socket_bind($sock,'127.0.0.1', 8888)) < 0)
echo "failed to bind socket: ".socket_strerror($ret)."n";
if( ( $ret = socket_listen( ...
Posted on Thu, 28 May 2020 10:07:18 -0400 by jay7981
Installation and verification of JWT Auth in laravel
1. Use composer to install jwt, cmd to the project folder;
Composer require tymon / JWT auth 1.0. * (here the version number is written according to your own needs)
Install jwt, refer to official documentation https://jwt-auth.readthedocs.io/en/docs/laravel-installation/
2. If the laravel v ...
Posted on Thu, 28 May 2020 08:48:45 -0400 by bacarudaguy
Using PDO constructor to connect database and DSN
$dbms = 'mysql';
$dbname = 'test';
$user = 'root';
$pwd = '123456';
$host = 'localhost';
$dsn = "$dbms:host=$host;dbName=$dbname";
$pdo = new PDO($dsn,$user,$pwd);
echo 'pdo Successfully connected to database';
echo $e->getMessage().'<br> ...
Posted on Mon, 25 May 2020 04:04:46 -0400 by duall
php connects to mysql database
Five steps for PHP to access MYSQL database
1. Connect to MySQL database
Using MySQL_ The connect() function establishes a connection to the MySQL server.
2. Select MySQL database
Using MySQL_ select_ The db() function selects the database of the MySQL database server.
3. Execute SQL statement
Using MySQL in the s ...
Posted on Sun, 24 May 2020 23:44:39 -0400 by qbox
Verification details of php forms
Posted on Sun, 24 May 2020 22:02:21 -0400 by sgiandhu
BUG s have recently appeared online, and it is after server migration that a lua script that finds nginx cannot collect log data for nginx
After sorting, it was found that because lua could not find the corresponding file, the nginx data could not be written to the file.That is, lua cannot create the create file directory and therefore cannot f ...
Posted on Fri, 22 May 2020 23:54:39 -0400 by davidx714
cd to the project directory, and then do the following
Prepare to install the framework: composer create project topthink / think thinkphp6.0
cd switch to the thinkPHP6.0 directory of PHP project
Modify configuration file:. Env configuration file / / copy example.env Change to your own
Open debug mode: app in. env_ DEBUG = ...
Posted on Fri, 22 May 2020 10:08:32 -0400 by benny_g
The input field mark introduced by PHP form element < input >
Input field flag < input >
The input field tag < input > is one of the most commonly used tags in forms. Common input field markers < input > include text box, button, radio button, check box, etc.
type attribute values and examples and descriptions:
Posted on Fri, 22 May 2020 00:53:02 -0400 by farsighted
Using FormData form data objects in H5, the name and value of all form elements in the form form form can be combined into a request string and submitted to the background.You can use js to simulate a series of form controls with some key-value pairs, or you can use the send() method of XMLHttpRequest to submit the form asynchronously.
Posted on Thu, 21 May 2020 12:37:40 -0400 by fean0r
In the concurrency scenarios such as seckill and rush to buy, oversold may occur. There is no native concurrency solution in PHP language, so we need to use other methods to achieve concurrency control.
Common solutions listed are:
With queue, an extra process is set up to process the queue, and the concurrent requests are put into the queue. I ...
Posted on Thu, 21 May 2020 10:24:07 -0400 by jtmathome