Blog

Download Dynamic Download Links

folder_openCoding, Snippets
commentNo Comments
PHP $file_url = 'https://webapi.vivotek.com/api/DownloadCenter/Download/global?p1=B96CdIFf5Mh4r7e%2B3jGe1g==&p2=j199RdC0wOvZ8pPmTck8Tg=='; $file_ext = pathinfo($file_url, PATHINFO_EXTENSION); // to get extension $file_name = pathinfo($file_url, PATHINFO_FILENAME); echo $file_ext, '<br />';echo $file_name; $curl = curl_init(); $headers = array(); curl_setopt($curl, CURLOPT_URL, $file_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 50); curl_setopt($curl, CURLOPT_HEADERFUNCTION, function($curl, $header)…
Click Me

Handling Cookies in JavaScript

folder_openCoding, Snippets
commentNo Comments
Getting the Cookies: function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null;…
Click Me

MySQL – Drop all Tables from Command Line

folder_openCoding, Snippets
commentNo Comments
DROP PROCEDURE IF EXISTS `drop_all_tables`; DELIMITER $$ CREATE PROCEDURE `drop_all_tables`() BEGIN DECLARE _done INT DEFAULT FALSE; DECLARE _tableName VARCHAR(255); DECLARE _cursor CURSOR FOR SELECT table_name FROM information_schema.TABLES WHERE table_schema = SCHEMA(); DECLARE CONTINUE HANDLER FOR NOT FOUND SET _done =…
Click Me
Menu