Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
AJAX Bootstrap
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / V4 / Downloads & Updates

2021-08-09 21:43:47
New Bootstrap loader to handle AJAX requests independently.

bootstrap.php

<?
// ST AJAX Bootstrapper
require_once '../config.php';

// Autoloader
spl_autoload_register(function ($className) {
   include_once '../classes/' . $className . '.php';
});

// Init objects
$account = new STAccounts;
$db = $CONFIG['db']['type'] == 'mysql' ? new MySQLConnect : new PostgreSQLConnect;

// Connect to db
$db->connect();

// Additional functions
function html_escape(string $s): ?string
{
   return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
}


AJAX files:
require_once 'bootstrap.php';


More updates will follow. This was a fluke idea I had, in order to seperate my ajax scripts and not rely on the main core files outside of the directory. Completely portable.
Last edited by STorrents2020 on 2021-08-09 21:57:31
2022-02-06 06:03:24
Sample code - post updated.
Last edited by STorrents2020 on 2022-02-07 03:41:12
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728