Posts

Showing posts from November, 2015

How to take a screenshot or make a image of current screen using php and javascript with jquery or make a pdf file of current scrren

For create a image of current screen using javascript add below script into your file <script type="text/javascript"> function printDiv() {     jQuery('.year_box').remove(); // add your container id for capcture screen here i write "main_panel_body" for example     html2canvas([document.getElementById('main_panel_body')], {           onrendered: function(canvas)          {             var img = canvas.toDataURL();             jQuery('.overlay_box').show(); // calling ajax method for create image from binary data             $.post("save.php", {data: img}, function (file) {                 jQuery('.overlay_box').hide();  ...

How to use ajax without jquery with pure javascript

Here is a snippet code for ajax request.. var ajax = {}; ajax.x = function() {     if (typeof XMLHttpRequest !== 'undefined') {         return new XMLHttpRequest();     }     var versions = [         "MSXML2.XmlHttp.6.0",         "MSXML2.XmlHttp.5.0",          "MSXML2.XmlHttp.4.0",         "MSXML2.XmlHttp.3.0",          "MSXML2.XmlHttp.2.0",         "Microsoft.XmlHttp"     ];     var xhr;     for(var i = 0; i < versions.length; i++) {         try {             xhr = new ActiveXObject(versions[i]);          ...

How to upload image to another server like amazon etc using php CURL

For upload an image or any file to external server using php curl just refer below code. and change it according to your need. $profile_image_string = '';             if ( isset($_FILES['profile_image']) )             {                 $tmpfile = $_FILES['profile_image']['tmp_name'];                 $filename = basename($_FILES['profile_image']['name']);                 $filetype = $_FILES['profile_image']['type'];                 $org_image_string =curl_file_create($tmpfile,$filetype,$filename);             }     $ch = curl_init();         ...