Posts

Showing posts from December, 2012

Open color box on Page load

This code working with all frameworks.             Required Latest versions of :-                     1-colorbox.js                     2-jquery.min.js                     2- Download                 < script type = "text/javascript" > var j = jQuery.noConflict(); j( document ).ready( function (){ j.fn.colorbox({width : "685px;" ,overlayClose : false , escKey : false , inline : true , href : "#inline_content" }); j( "#cboxClose" ).remove(); }); < /script>

Safe name of a file by php

 function filename_safe($filename) {     $temp = $filename;      // Lower case     $temp = strtolower($temp);         // Replace spaces with a "_"     $temp = str_replace(" ", "_", $temp);         // Loop through string     $result = "";     for ($i=0; $i<strlen($temp); $i++) {     if (preg_match("([0-9]|[a-z]|_)", $temp[$i])) {     $result = $result . $temp[$i];     }     }     // Return filename     return $result;     }         function safe_filename ($filename) {     $search = array(     // Definition of German Umlauts START     "/ß/",     "/ä/","/Ä/",     "/ö/","/Ö/",     "/ü/","/Ü/",     // Definition of German Umlauts ENDE     "([^[:alnum:]_])" // Disallow: Not alphanumeric, dot or underscore     );     $replace = array(     "ss",     "ae","Ae",     "oe","Oe",