Submit Blog Login Last Submitted Blogs RSS Archive Contact  
Smash Scripts
 
 
 
Smash Scripts
Quality Scripts are available Like PHP,Java,Ajax,ASP.Net Scripts etc..
Language: English
RSS Feeds for this Blog
Statistics
Unique Visitors: 250
Total Unique Visitors: 423034
Visitors Out: 1327
Total Visitors Out: 1741
 
 
Articles
PHP-Convert any HTML file into PDF
2007-06-29 01:22:00
############################################################################ Function to Convert any HTML file into PDF Can save into a pdf file on server, or stream to the user's browser If you want to stream to the browser: $objClass->fnURL2PDF("http://www.yahoo.com", "pdf.pdf"); If you want to save on the server: $objClass->fnURL2PDF("http://www.yahoo.com", "", "../folder/filename.pdf"); Usage: $objClass->fnURL2PDF("http://www.yahoo.com", "pdf.pdf"); Default is USA ############################################################################ function fnURL2PDF($varURL, $varFileName = "pdf.pdf", $varSavePath = "") { $varSocket = fsockopen("www.easysw.com", 80, $errno, $errstr, 1000); if (!$varSocket) die("$errstr ($errno) "); fwrite($varSocket, "GET /htmldoc/pdf-o-matic.php?URL=" . $varURL . "&FORMAT=.pdf HTTP/1.0 "); fwrite($varSocket, "Host: www.easysw.com "); fwrite($varSocket, "Referer: http://www.easysw.com/htmldoc/pdf-o-matic.php "); fwrite($varSocket, " ");...
 
PHP-Get a Value from XML Settings file
2007-06-29 01:19:00
############################################################################ Function to Get a Value from XML Settings file provided as a second argument Default is ../main/settings.xml: standard for all of our current projects Usage: $objClass->fnGetProperty("SiteURL", "settings.xml"); ############################################################################ function fnGetProperty($varPropName, $varXMLFile = '../main/settings.xml') { $objXML = new clsXML($varXMLFile); $varValue = $objXML->evaluate("//" . $varPropName); $varRetValue = $objXML->get_content($varValue[0]); $objXML = NULL; return($varRetValue); }Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any los...
 
PHP-Generate Random Password
2007-06-29 01:09:00
############################################################ Function to Generate Random Password of length n, Default = 6 characters Usage: $objClass->fnRandomPasswordGenerator(16);########################################################### function fnRandomPasswordGenerator($length = 6) { $pass = ''; $new = ''; // all the chars we want to use $all = explode(" ", "a b c d e f g h i j k l m n o p q r s t u v w x y z " ."A B C D E F G H I J K L M N O P Q R S T U V W X Y Z " ."0 1 2 3 4 5 6 7 8 9"); for($i=0; $i < $length; $i++) { srand((double)microtime()*1000000); $pass .= $all[rand(0,61)]; $arr[] = $all[rand(0,61)]; $new .= $arr[$i]; } return $new; }Disclaimer: Any code or advice given is for instructional purposes only. We wi...
 
PHP- File Attachment
2007-06-29 01:06:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP- Calculate Elapsed time (in seconds!)
2007-06-29 01:00:00
function calcElapsedTime($time) { $diff = time()-$time; $yearsDiff = floor($diff/60/60/24/365); $diff -= $yearsDiff*60*60*24*365; $monthsDiff = floor($diff/60/60/24/30); $diff -= $monthsDiff*60*60*24*30; $weeksDiff = floor($diff/60/60/24/7); $diff -= $weeksDiff*60*60*24*7; $daysDiff = floor($diff/60/60/24); $diff -= $daysDiff*60*60*24; $hrsDiff = floor($diff/60/60); $diff -= $hrsDiff*60*60; $minsDiff = floor($diff/60); $diff -= $minsDiff*60; $secsDiff = $diff; return (''.$yearsDiff.' year'.(($yearsDiff 1) ? "s" : "").', '.$monthsDiff.' month'.(($monthsDiff 1) ? "s" : "").', '.$weeksDiff.' week'.(($weeksDiff 1) ? "s" : "").', '.$daysDiff.' day'.(($daysDiff 1) ? "s" : "").', '.$hrsDiff.' hour'.(($hrsDiff 1) ? "s" : "").', ...
 
PHP- Read contents of a text file
2007-06-29 00:59:00
############################################################################# # Function to Read contents of a text file # Usage: $objClass->fnReadFromFile('filename.txt');# ############################################################################ function fnReadFromFile($sFileName) { $sReturn = ''; $fHandle = fopen($sFileName, "r"); while (!feof($fHandle)) $sReturn .= fread($fHandle, 4096); fclose($fHandle); return($sReturn); }Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP-A Unique session id
2007-06-29 00:55:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP- Upload and convert avi, wmv, mov and mpg videos to FLV
2007-05-31 01:33:00
Upload and convert avi, wmv, mov and mpg videos to FLV using PHP1.First you have to create a page from where the user will upload a video lets call it uploadvideo.php. follow the code below..<form name=”frm” action=”uploadvideopro.php” method =”post” enctype="multipart/form-data" > <input name="x_URL" type="file" > </form> 2.Secondly on the process page i.e. uploadvideopro.php . follow the following code.. /***************Load FFMPEG *********************************/ $extension = "ffmpeg"; $extension_soname = $extension . "." . PHP_SHLIB_SUFFIX; $extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname; // load extension if (!extension_loaded($extension)) { dl($extension_soname) or die("Can't load extension $extension_fullname "); } /***********************************************************/ /*****************Get the path to Extention ****************/ $array_path = explode("/",$_SERVER['SCRIPT_FILENAME']); $dynamic_path = ""; for ($i=0;$i<sizeof($array_path)-1;$i++) if($array_path[$i]!="") $dynamic_path =$dynamic_path."/".$array_path[$i];/**********************************************************/ /******************set folders*****************************/ $flvpath = "flvfiles/"; $moviepath = "movies/" ; chmod($moviepath,0777); chmod($flvpath,0777); /*********************************************************//******************Upload and convert video *****************************/ if(isset($_FILES["x_URL"])) { $fileName = $_FILES["x_URL"]["name"]; $fileNameParts = explode( ".", $fileName ); $fileExtension = end( $fileNameParts ); $fileExtension = strtolower( $fileExtension ); if($fileExtension=="avi" || $fileExtension=="wmv" || $fileExtension=="mpeg&...
 
PHP-IP Logger
2007-05-28 06:16:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP-Daily (random) banner
2007-05-25 02:19:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP-Get TemplateMonster data
2007-05-25 02:02:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP-Text wrapper plus
2007-05-25 01:51:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP-URL / domain name splitter
2007-05-25 01:48:00
Disclaimer : Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP-Simple attachment mail script
2007-05-25 01:45:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
PHP- Client URL Library Function
2007-04-03 00:16:00
Disclaimer: Any code or advice given is for instructional purposes only. We will not be responsible for any loss or damage caused by using this script....
 
Javascript-Sorting Dates in List Box
2007-03-31 00:52:00
<html><head><title>Javascript-Sorting Dates in List Box</title><script language="JavaScript">function Sort_Dates() { var x, y, holder; var list_box = document.frm.list_dates; FirstDate = new Date(); SecondDate = new Date(); for(x = 0; x < list_box.options.length; x++) { for(y = 0; y < (list_box.options.length-1); y++) { array_first = list_box.options[y].value.split("/"); array_second = list_box.options[y+1].value.split("/"); FirstDate.setMonth(array_first[0]); FirstDate.setDate(array_first[1]); FirstDate.setYear(array_first[2]); SecondDate.setMonth(array_second[0]); SecondDate.setDate(array_second[1]); SecondDate.setYear(array_second[2]); if (FirstDate >SecondDate) //here you can mod...
 
PHP-CURL and You
2007-03-31 00:19:00
The first step in using CURL is to create a new CURL resource, by calling the curl_init() function, like so:Now that you've got a curl resource, it's possible to retrieve a URL, by first setting the URL you want to retrieve using the curl_setopt() function:After that, to get the page, call the curl_exec() which will execute the retrieval, and automatically print the page:Finally, it's probably wise to close the curl resource to free up system resources. This can be done with the curl_close() function, as follows:That's all there is to it, and the above code snippets together form the following working demo: The only problem we have now is that the output of the page is immediately printed, but what if we want to use the output in some other way? That's no problem, as there's an option call...
 
 
 
 
eXTReMe Tracker