PHP code example of ratipriya / sngine-faq-module

1. Go to this page and download the library: Download ratipriya/sngine-faq-module 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/ */

    

ratipriya / sngine-faq-module example snippets




/**
 * update wizard
 * 
 * @package Sngine
 * @author Zamblek
 */

// set execution time
set_time_limit(0); /* unlimited max execution time */

// set ABSPATH & BASEPATH
define('ABSPATH', __DIR__ . '/');
define('BASEPATH', dirname($_SERVER['PHP_SELF']));
get config file
tions.php');


// update
if (isset($_POST['submit'])) {

    // check purchase code
    try {
        $licence_key = get_licence_key($_POST['purchase_code']);
        if (is_empty($_POST['purchase_code']) || $licence_key === false) {
            _error("Error", "Please enter a valid purchase code");
        }
        $session_hash = $licence_key;
        $JWT_SECRET = md5($licence_key);
        $faq = new SngineFAQ(true, $db);
    } catch (Exception $e) {
        _error("Error", $e->getMessage());
    }

    // finished!
    _error("FAQ Module Imported", "Sngine FAQ Module has been imported successfully");
}