PHP code example of liesauer / ql-plugin-simpleform

1. Go to this page and download the library: Download liesauer/ql-plugin-simpleform library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liesauer / ql-plugin-simpleform example snippets


use liesauer\QLPlugin\SimpleForm;
use QL\QueryList;

zzleHttp\Cookie\CookieJar();

$ql = QueryList::getInstance();

// use this plugin
$ql->use(SimpleForm::class);

$username = $ql->simpleForm('https://github.com/login', '', [
    'options' => [
        'verify'  => false,
        'cookies' => $cookie,
    ],
], [
    'params'  => [
        'login'    => 'username',
        'password' => 'password',
    ],
    'options' => [
        'verify'  => false,
        'cookies' => $cookie,
    ],
])->find('.header-nav-current-user>.css-truncate-target')->text();

if (!empty($username)) {
    echo "welcome back, {$username}!\n";
} else {
    $error = $ql->find('.flash-error>.container')->text();
    echo "{$error}\n";
}