Create and download excel file or report in php
Uncategorized / August 14, 2015

First of all download excel-report.zip and extract it. You will find index.php in root and one more folder. Open index.php and take a look at the code. Code itself is self descriptive and well commented. You can add column heading and records. You can also add color in particular cell or entire row. If you want to set bold font for particular cell or row,it is also given in code. Width of any column in excel file is adjustable.I have set it to auto adjust.

Integrate WhatsApp share in web application
Uncategorized / July 9, 2015

First of all download whatsapp-share.zip and extract it. You will find index.html in root and three more folders. Open index.html. Look for the anchor tag.There are two custom attributes “data-text” and “data-link”. Value of “data-link” is the link which you want to share on WhatsApp. Value of “data-text” is short description about the link. Host it on server and access it using mobile. Now click on share button,you will be redirected to WhatsApp with some contents in text box.

PHP code to get photos from facebook album
Uncategorized / July 9, 2015

Well,It is very easy.You need to follow few steps as given below. Create a facebook application by visiting developers.facebook.com. You will get “App ID” and “App Secret” keys. Now download facebook-album-photo.zip and extract it. Open index.php file and put credentials obtained in step1. Now visit your index.php and login using login link. You will see all your album’s images. As you can see in index.php file,there is one more module to retrieve photos.

Simple php script for facebook keyword search
Uncategorized / June 29, 2015

Create a facebook application by visiting developers.facebook.com. You will get “App ID” and “App Secret” keys. Now download facebooksearch.zip and extract it. Open src/config.php file and put credentials obtained in step1. Also enter callback URL.Callback URL is where your application will redirect after successful login. Now visit your index.php and search for keywords.

Page updated but Facebook showing old page contents
Uncategorized / June 22, 2015

Facebook not fetching new page contents You might be using facebook for your website promotion. Sometimes you might have experienced problem while re-fetching your updated page. Facebook shows old image or old page contents. This is it’s normal behaviour.Facebook uses cache. When you post any URL for first time,it is cached in facebook. Later, when you update your page contents and try to fetch that page,facebook shows earlier contents. Solution for that is,you need to flush cached version of your page by following method. visit https://developers.facebook.com/tools/debug/og/object/. Enter your URL in input field and press “Fetch new scrape information” button. Now you can share your URL and facebook will fetch new contents.

Simple php script for twitter hash tag search
Uncategorized / June 18, 2015

Twitter hash tag search is now being most widely used in many organizations. To integrate twitter hashtag search into your application follow the below steps. Create twitter application by visiting create new twitter app. Put your application name,description and website url in respective fields.Callback url is not necessary for our application. Select “Yes,I agree” at the bottom side and click “Create your Twitter application” button.Your application is created. Now visit twitter app and select(click on) app you just created. Select “Keys and Access Tokens”.You will get “Consumer Key” and “Consumer Secret”.Now scroll down and generate “Access Token” and “Token Secret” by clicking on generate access token button.Thus you have obtained all credentials needed for our application. Now download twitter-hashtag-search.zip and extract it. Open search.php file and put credentials obtained in earlier steps. Code is very simple and well commented.Read comments and put your inputs as needed. Thats it, your twitter hash tag search application is ready. Now run the script and you will get all tweets containing your hash tag.

ffmpeg add or embed text into image on iis or xampp server
Uncategorized / June 18, 2015

Download video_processing.zip and dejavu-fonts-ttf.tar.bz2 and extract it.Note- copy both the files in your project directory. We are going to use php exec() function to execute commands related to image processing. C:\>ffmpeg -i inputimage.png -vf drawtext=”fontfile=ttf\DejaVuSerif.ttf: text=’Dinesh Belakare’:fontsize=70:fontcolor=red:x=700:y=925″ outputimage.png In the above code replace “ffmpeg” with absolute path (i.e C:\directory\ffmpeg).Also replace inputimage.png and outputimage.png with their absolute path.Note- outputimage.png is not present and will be generated after successful execution of the command,but we have to put it’s path in the command. Your command will look like this C:\>C:\directory\ffmpeg -i C:\directory\inputimage.png -vf drawtext=”fontfile=C:\directory\ttf\DejaVuSerif.ttf: text=’Dinesh Belakare’:fontsize=70:fontcolor=red:x=700:y=925″ C:\directory\outputimage.png Once you you run above command in windows cmd,you will get your outputimage.png with text added to it. If you want to do this in PHP, you just have to put it in exec() function.i.e. exec(C:\>C:\directory\ffmpeg -i C:\directory\inputimage.png -vf drawtext=”fontfile=C:\directory\ttf\DejaVuSerif.ttf: text=’Dinesh Belakare’:fontsize=70:fontcolor=red:x=700:y=925″ C:\directory\outputimage.png) Note- Please place quotes properly in the above command string while using for php.

ffmpeg add or embed text into video on iis or xampp server
Uncategorized / June 11, 2015

Download video_processing.zip and dejavu-fonts-ttf.tar.bz2 and extract it.Note- copy both the files in your project directory. We are going to use php exec() function to execute commands related to video processing. C:\>ffmpeg -i inputvideo.mp4 -vf drawtext=”fontfile=ttf\DejaVuSerif.ttf: text=’+919987688035′:fontsize=70:fontcolor=red:x=700:y=925:enable=’between(t,61.6,78)'” outputvideo.mp4 In the above code replace “ffmpeg” with absolute path (i.e C:\directory\ffmpeg).Also replace inputvideo.mp4 and outputvideo.mp4 with their absolute path.Note- outputvideo.mp4 is not present and will be generated after successful execution of the command,but we have to put it’s path in the command. Your command will look like this C:\>C:\directory\ffmpeg -i C:\directory\inputvideo.mp4 -vf drawtext=”fontfile=C:\directory\ttf\DejaVuSerif.ttf: text=’+919987688035′:fontsize=70:fontcolor=red:x=700:y=925:enable=’between(t,61.6,78)'” C:\directory\outputvideo.mp4 Once you you run above command in windows cmd,you will get your outputvideo.mp4 with text added to it. In above code “between(t,61.6,78)” means text will be added during time frame of 61.6 and 78 seconds of the original video. If you want to do this in PHP, you just have to put it in exec() function.i.e. exec(C:\>C:\directory\ffmpeg -i C:\directory\inputvideo.mp4 -vf drawtext=”fontfile=C:\directory\ttf\DejaVuSerif.ttf: text=’+919987688035′:fontsize=70:fontcolor=red:x=700:y=925:enable=’between(t,61.6,78)'” C:\directory\outputvideo.mp4) Note- Please place quotes properly in the above command string while using for php.

Htaccess code to enable Leverage browser caching
Uncategorized / May 26, 2015

############################### #ENABLE BROWSER CACHING START ############################### ExpiresActive On ExpiresByType text/html “access plus 1 month” ExpiresByType image/gif “access plus 1 month” ExpiresByType image/jpeg “access plus 1 month” ExpiresByType image/png “access plus 1 month” ExpiresByType text/css “access plus 1 month” ExpiresByType text/javascript “access plus 1 month” ExpiresByType application/x-javascript “access plus 1 month” ExpiresByType image/x-icon “access plus 1 month” ExpiresDefault “access plus 1 month” ############################### #ENABLE BROWSER CACHING END ###############################

Htaccess code to enable gzip compression
Uncategorized / May 26, 2015

############################### #ENABLE GZIP COMPRESSION START ############################### SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip Header append Vary User-Agent env=!dont-vary ############################### #ENABLE GZIP COMPRESSION END ###############################