Skip to content

Instantly share code, notes, and snippets.

View ronniengoda's full-sized avatar
🤓
Talk is cheap show me the CODE

Ronald Ngoda ronniengoda

🤓
Talk is cheap show me the CODE
View GitHub Profile
@ronniengoda
ronniengoda / global-search.php
Created October 1, 2022 12:34 — forked from bigprof/global-search.php
Basic script to perform global search on all tables of an AppGini application.
<?php
/**
* Basic script to perform global search on all tables of an AppGini application.
* Create a new file inside the hooks folder and name it 'global-search.php' then copy this code to it.
* Related post: https://forums.appgini.com/phpbb/viewtopic.php?f=2&t=1689&p=4510
*/
/* Assuming this custom file is placed inside 'hooks' */
define('PREPEND_PATH', '../');
$hooks_dir = dirname(__FILE__);
@ronniengoda
ronniengoda / simple-json-reponse.php
Created July 1, 2019 13:16 — forked from james2doyle/simple-json-reponse.php
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($message = null, $code = 200)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");