Blogs

PHP

REMEMBER LOGIC IN LOGIN

On Login: if(isset($_POST[‘remember’])) { $month = time() + ( ( 3600 * 24 ) * 30 ); setcookie(‘remember_me’, $user_id, $month); } else { $past = time() – 100; setcookie(‘remember_me’, ”, $past); } On Logout: $past = time() – 100; setcookie(‘remember_me’, ”, $past); if( isset($_COOKIE[‘remember_me’]) AND trim($_COOKIE[‘remember_me’] ) != “” ) { //Store the sessions which […]

PHP

HTTPCODE

<?phpnamespace App\Http;class HttpCode{/** HTTP Status Codes & their meaning* Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes* By: Yentel Hollebeke – https://github.com/yentel* TODO: add remaining comments with code descriptions*//** Informational codes (1xx)*//*** 100 – Continue* The server has received the request headers and the client should proceed to send the request body* (in the case of a request for which a body needs […]

PHP

ADD A COOKIE CONSENT FEATURE

?php%20echo%20SITE_URL;%20?js/jquery.min.js?php%20echo%20SITE_URL;%20?js/jquery.cookieMessage.min.js $.cookieMessage({‘mainMessage’: ‘This website uses cookies. By using this website you consent to our use of these cookies. For more information visit our “>Privacy Policy. ‘,‘acceptButton’: ‘Got It!’,‘fontSize’: ’16px’,‘backgroundColor’: ‘#222’,});