Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

Navman white or black screen fix


When my unit turns on, it only displays a white or black screen. How can I fix this?

To resolve the white screen issue on your unit, please follow the steps below:

1. Connect Navman GPS to PC via mini-USB cable.
2. Go to ‘Start’
3. Go to ‘My Computer’
4. Open the Navman Unit
5. Open the ‘Navman’ folder
6. Open the ‘Database’ folder
7. Delete the following file only – ‘database.db’
8. Close the folders
9. Disconnect the mini-USB cable then restart the Navman GPS by sliding the switch to ‘Restart’ then back to ‘On’ after 10 seconds

Please Note: The database.db file will be generated automatically once the folder is closed.

Resource: link

Javascript Validate two input fields with the same name?

<div style=”” id=”shipping-new”>
<table class=”form”>
<td><span class=”required”>*</span> Post Code:</td>
<td><input type=”text” class=”large-field” value=”” name=”postcode”><span class=”error”>Sorry, we cannot deliver to your area!</span></td>
</div> Read more of this post

Copy recursively directory structure using Linux Command

How to copy a directory/folder structures in a single command
Create a new directory
Cd new_directory
Run the following command
Where “../catalog” is the source location
***Remember to backup before running this script.


find ../catalog -type d -printf “%P\n” | xargs mkdir -p

find ../admin -type d -printf “%P\n” | xargs mkdir -p

Great JS Webtool for Developers: Aardvark

Clean up unwanted banners and surrounding “fluff,” especially prior to printing a page See how the page is created, block by block View the source code of one or more elements

Once you have installed Aardvark as a bookmarklet (it takes about ten seconds!), you may start it at any time by selecting it from the bookmarks menu or toolbar. Aardvark will run until you press the “Q” key to quit, or leave the page or refresh it.

Example of red highlightingAs you glide the mouse over the page, you will see a red rectangle framing each element under the cursor. You will also see a little yellow caption showing the HTML element type and its class or id if they exist. Pressing certain keys on the keyboard (see below) will do various things, as described in the Keystroke list below.

Online ICON (*.ico) File Creator

iConvertv2.9 converts and creates Windows, Mac and Linux icons in one step!

iConvert Icons has been carefully designed to make it as easy as possible to create and convert icons. It creates icons in all of the popular icon formats, including png, ico, and icns. It is also the only icon converter to support converting directly from SVG. All you need to do is drag and drop – iConvert Icons converts the images into icons with only a single click. 

Free Canon DSLR Photgraphy Course

Canon’s Photography 101 online class:

Topics covered include:

  1. Shooting Modes
  2. Aperture
  3. Shutter-Speed
  4. ISO
  5. Depth of field
  6. Lenses (normal, telephoto, wide-angle, macro, fish-eye, tilt-shift)
  7. Sensor size (APS-C, APS-H, Full-frame)

It’s very good reading. I went and read the whole web page and I found a couple nuggets.

This is a great free resource for beginner & intermediate photographers.

jQuery UI icons

Here you can find the list: jQuery UI icons

  • .ui-icon-carat-1-n
  • .ui-icon-carat-1-ne
  • .ui-icon-carat-1-e
  • .ui-icon-carat-1-se
  • .ui-icon-carat-1-s
  • .ui-icon-carat-1-sw
  • .ui-icon-carat-1-w
  • .ui-icon-carat-1-nw
  • .ui-icon-carat-2-n-s
  • .ui-icon-carat-2-e-w Read more of this post

Top Free Secure SFTP Clients for Windows

Top Free Secure SFTP Clients for Windows
If you want to transfer files to Linux; use one of the most recommended tools below:

  • WinSCP
  • PSCP and PSFTP (from PuTTY)
  • Filezilla
  • FireFTP
  • CoreFTP LE
  • Swish – SFTP from Windows Explorer
  • BitKinex

Impressive WordPress Themes

Opencart Removing Estimate Shipping & Taxes v1.5.1

1. Login to admin (backend)
2. Choose Extensions ->Order Totals
3. Edit “Shipping”
4. Set “Shipping Estimator:”: Disabled.
5. Press Save button.
6. Done

২০১৩ সালের সেরা ৫০ ওয়েবসাইট

২০১৩ সালের সেরা ৫০ ওয়েবসাইট

 প্রতিবছর মার্কিন প্রকাশনা টাইম ম্যাগাজিন বিভিন্ন ক্ষেত্রে সেরাদের তালিকা প্রকাশ করে। সম্প্রতি টাইম ম্যাগাজিনের দৃষ্টিতে ২০১৩ সালের সেরা ৫০টি ওয়েবসাইটের তালিকা প্রকাশ করেছে। এতে ১০টি ক্যাটাগরিতে ৫০টি ওয়েবসাইট শীর্ষ তালিকায় এসেছে। সেসব ওয়েবসাইট নিয়েই এবারের মেইনবোর্ড। দ্বিতীয় কিস্তিতে আজ থাকছে ওয়েব টুলস এবং সামাজিক যোগাযোগের সাইট|

ওয়েব টুলস বিষয়ক সাইট


গুগল যেখানে অনেক মানুষের প্রিয় আরএসএস ফিডার নিয়ে আশা-আকাঙ্ক্ষার প্রতিফলন ঘটাতে পারেনি সেখানে এর উত্তম প্রতিস্থাপন করার সম্ভাবনা দেখা দিয়েছে। বলা হচ্ছে, এই সাইটটি গুগলের তুলনায় ভালো আরএসএস ফিডারের সার্ভিস চালু করেছে এবং তা হালনাগাদসহ এই সার্ভিসের উন্নয়ন ঘটাতে তৎপর রয়েছে।

মাই পারমিশন্স 

ওয়েবে এটি একটি কমিউনিটি সার্ভিস, যেখানে ব্যক্তিগত নিরাপত্তা সংরক্ষিত রেখে ফেইসবুক, টুইটার, গুগল এবং অন্যান্য সামাজিক নেটওয়ার্ক সাইটে আপনার অ্যাকাউন্ট ব্যবহারের অনুমতি চাইবে। আর অনুমতি দেওয়া হলে লিংকের মাধ্যমে নির্দিষ্ট তথ্য এক্সেস করা যাবে। যখন আপনার ফেইসবুকসহ অন্যান্য অ্যাপস হতে আপনার ব্যক্তিগত তথ্য এক্সেস করা হবে তখন স্বয়ংক্রিয়ভাবে আপনি অ্যালার্ট পাবেন এবং চাইলে একটিমাত্র ক্লিকের মাধ্যমে তা মুছে ফেলতে পারবেন। ব্যক্তিগত তথ্যসমূহ সুরক্ষিত রাখতে এই টুল ব্যবহার করা যেতে পারে।
Read more of this post

Some Linux useful IP commands

Display Current Config for all NIC’s: ifconfig

Display Current Config for eth0: ifconfig eth0

Assign IP: ifconfig eth0

Ping: ping -c 3

Assign multiple IP’s: ifconfig eth0:0

Assign second IP: ifconfig eth0:1

Disable network card: ifconfig eth0 down

Enable network card: ifconfig eth0 up

View current routing table: route “or” route -n

View arp cache: arp “or” arp -n

Assign IP/Subnet: ifconfig eth0 netmask

Assign Default Gateway: route add default gw

Trace Route: traceroute

Trace Path: tracepath

DNS Test: host

Advanced DNS Test: dig

Reverse Lookup: host

Advanced Reverse Lookup: dig -x

*You MUST be at the ROOT user to make/save any changes. Linux users, your distribution will determine the location of your network config file which will need to be updated and saved in order for the changes to remain in effect after rebooting. Network cards are referred to as eth0, eth1, eth2, etc based on their position on the PCI bus.
*Special thanks to Gergely for the Linux commands!


Ext.NET Examples Explorer (Version 1.6)

Frame not found in cellmap

You have to be careful how complex your HTML layout is. In fact I’ve found the simpler, the better (and yes, that means the use of HTML tables quite often).
The reason this error was occurring was because I had a DIV tag that was spanning onto two pages. The fix was super easy; I simply changed the DIV tag to a SPAN.
This also seems to occur with tags; again I replaced these with a span tag.

OpenCart – How to customize the order confirmation and registration email?

To change the order confirmation email, access your store files on FTP and go to the following directory:


Open the order.php file to make the changes you need. You will see the text to edit in quotation marks on the right when you open the file.

In order to edit the the customer registration email, on your FTP go to:


and make your changes to the customer.php file.

How to show the default cookie set page if you are not allowed to visit a page

setcookie("testcookie", "testvalue");
if(!isset( $_COOKIE['testcookie'] ) && $_SERVER['SCRIPT_NAME'] != '/enable-cookies.php' && $_SERVER['SCRIPT_NAME'] != '/index.php'  && $_SERVER['SCRIPT_NAME'] != '/contact_us.php') tep_redirect(tep_href_link('enable-cookies.php'));

Block Google and bots using htaccess and robots.txt

User-agent: *
Disallow: /


RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule ^.*$ “http\:\/\/domainname\” [R=301,L]

How to force browser to resize when window resizing doesn’t work

How to hide window scrollbar for IE, FF and Google Chrome

It is easy if you add the attribute scrollbars=no inside the‘s window attributes. But what if you wish to hide them when the popup window is already open. Thank you CSS! Yes, it is possible by using Javascript and accessing the window style’s property overflow. However, there is a cross-browser issue. Both IE and Firefox/Google Chrome have different codes that make this work. You can place both their codes in the same page and/or Javascript function. If the browser does not understand the property, it will ignore it anyway so there is no need to do a browser check to execute the code specific to that certain browser.
The code below does the trick: = 'hidden'; // firefox, chrome
document.body.scroll = "no"; // ie only

Just in case you wish to disable either just the horizontal or vertical scrollbar, this code works for non IE browsers = 'hidden'; // horizontal scrollbar will be hidden = 'hidden'; // vertical scrollbar will be hidden

Bluehost error: [an error occurred while processing this directive]


For the benefit of anyone encountering a similar problem, try the steps that follow:

– Go to cPanel
– Open File Manager from Files section
– Navigate to domain folder
– Check “Perms” column on far right hand side
– Files should be set to: 0644 (this is the UNIX file permissions)
– Folders should be set to: 0755

This will change your file permissions to their proper settings for the Bluehost file system. Additionally, if you have PHP code within.htm or .html files, you will need to add an additional Apache handler to tell Bluehost to parse these files as PHP. Do this using Apache Handlers in cPanel:

HANDLER: application/x-httpd-php5s
EXTENSIONS: .php .htm .html

Opencart coupon history not working with Paypal

in catalog/model/checkout/coupon.php


  public function getCoupon($code) {



 public function getCoupon($code,$noverify=0) {

AND change


       if ($status) {
             return array(



       if (($status)||($noverify)) {
             return array(

Next, in catalog/model/total/coupon.php in the confirm function right near the bottom change


    $coupon_info = $this->model_checkout_coupon->getCoupon($code);



    $coupon_info = $this->model_checkout_coupon->getCoupon($code,1);

Here is the VQMod xml file:

<?xml version="1.0" encoding="utf-8"?>
<id>Fix Coupon Codes (so they register after using paypal or similar payment gateway)</id>
<author>Sanjoy Roy </author>
<file name="catalog/model/checkout/coupon.php">
<search position="replace"><![CDATA[ public function getCoupon($code) { ]]></search>
<add><![CDATA[ public function getCoupon($code, $verify = true) { ]]></add>
<search position="replace"><![CDATA[ if ($status) { ]]></search>
<add><![CDATA[ if ($status || $verify === false) { ]]></add>

<file name="catalog/model/total/coupon.php">
<search position="replace"><![CDATA[ $coupon_info = $this->model_checkout_coupon->getCoupon($code); ]]></search>
<add><![CDATA[ $coupon_info = $this->model_checkout_coupon->getCoupon($code, false); ]]></add>

Combining animation and ActionScript using Flash Professional CS5 and Flash Builder 4

Adobe Configuration Error 130:10

Configuration Error 130:10

How to bypass Apache password protected directories without showing popup login

.htaccess for CMSMS

 Options +FollowSymLinks
 DirectoryIndex index.htm index.html index.php
 Options -Indexes 
  order allow,deny
  deny from all 
 ErrorDocument 403 /forbidden403.shtml
 ServerSignature Off

.htaccess for creloaded or osCommerce root

Options +FollowSymLinks
DirectoryIndex index.htm index.html index.php
RewriteEngine On
# proc/self/environ? no way!
RewriteCond %{QUERY_STRING} proc/self/environ [OR]
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a  tag in URL
RewriteCond %{QUERY_STRING} (|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
php_flag register_long_arrays On
php_flag register_globals On 
php_flag display_errors Off
php_value session.use_trans_sid 0
php_value register_globals 1
php_flag display_errors On
php_flag track_errors Off

www redirect issues Fix

How to change to

if ($_SERVER['HTTP_HOST'] != '') header('Location:' . $_SERVER['REQUEST_URI']);

If we use the cart, the cookies will be stored differently if we don’t use it. So, it will be always storing under domain Applied for the client SHE Lights.

Linux – Kill all processes for a user

Magento – how to display a page title and contents from backend

$terms_condtn_title = Mage::getModel('cms/page')->load('terms-and-conditions', 'identifier')->getTitle();
$terms_condtn_content = Mage::getModel('cms/page')->load('terms-and-conditions', 'identifier')->getContent();	
echo $terms_condtn_content;

Add a New system variable in Magento


INSERT INTO `amwsales_db`.`core_config_data` (
`config_id` ,
`scope` ,
`scope_id` ,
`path` ,
NULL , 'default', '0', 'design/footer/terms_condtn_txt', 'terms and condition text here'


$terms_condtn_txt = Mage::getStoreConfig('design/footer/terms_condtn_txt');

How to getBaseUrl in Magento

When developing in Magento and playing arround with Magento Themes there is some functions you should know.
If you want to get the source url of an image, javascript or file, call one of this functions adding your own path at the end.
Under every function there is an example of the output value:

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Deactivate Magento store using .htaccess temporarily

Here is quick snippet of code that we use all the time when upgrading or moving a Magento store. This will stop people from creating accounts, placing orders, etc… while you are in the middle of heavy database work.
Add this to your .htaccess file in your root directory and only your IP address will be able to view your website. All other visitors will get redirected to an “updating” page.
Add this to your .htaccess file (directly after RewriteEngine On):

RewriteCond %{REMOTE_HOST} !^
RewriteCond %{REQUEST_URI} !/updating.html$
RewriteRule .*$ /updating.html [R=302,L]

Do not forget to create a file called updating.html and put the message that you want visitors to see while your site is down.

jQuery Cookie Plugins

$.cookie('term_condtn', 'accepted', { expires: 1 });
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
        return cookieValue;

PHP Mobile Detection Library

Download this ZIP: click

      $iphoneTierHomePage = '';
      $genericMobileDeviceHomePage = '';
      $desktopHomePage = 'index.php';
      $uagent_obj = new uagent_info();         
      function AutoRedirectToProperHomePage(){
	      global $uagent_obj, $iphoneTierHomePage, $genericMobileDeviceHomePage, $desktopHomePage; 
	      if ($uagent_obj->isTierIphone == $uagent_obj->true) 
          header ('Location: '.$iphoneTierHomePage);          
	      else if ($uagent_obj->DetectMobileQuick() == $uagent_obj->true) 
          header ('Location: '.$genericMobileDeviceHomePage);        
          header ('Location: '.$desktopHomePage);

How to user FirePHP

*Install FirePHP FireFox add-ons (get a console like firebug), bottom status console bar in FF
* Copy FirePHP.class.php to the root file location

$firephp = FirePHP::getInstance(true);
$firephp->log($doc->load($url), 'doc');