I know this is a simple script that probably everyone already know, but I would like to keep it as a reminder for myself and everyone out there who doesn't know about it yet. For some reason, there are times when we need to know the full path of our web directory. So, let's say you installed zen cart on your web root directory. Generally, you will have something like httpdocs/includes as one of your installation folder. If someone asks you, what's the full path of that folder ? <?php echo $_SERVER['DOCUMENT_ROOT']; ?> The script above once executed will print out the full path of your current directory location. That alone should do it.
I have searched for countless freeware out there that can provide a quick image map capability, cuz for some reason I need that for my web projects. Quite recently I found one that's simple, easy to use, and most importantly it's FREE !! Please welcome Handy Image Mapper from silveragesoftware.com, i'm not by all means affiliated with this company/website, but i'm just amazed with its simplicity and yet it's capable to deliver quite an amazing result. You can download it here , look for 'Handy Image Mapper' title, and there you go.
Sometimes, the owners of ecommerce system would like to force the customers to choose store's default/chosen currency and why is that? Because, the instability of worldwide economy may cause the storeowners to loss profits during currency converting. Therefore, the storeowners have to ensure that it doesn't affect them by forcing their customers to select default currency (normally, it's the currency where the storeowner resides) during checkout process. The easy way is to hide the currency converter pulldown menu once the customer entered the checkout process and set the current currency to your chosen/default currency. The steps explained here assume that currency converter is placed on the header instead of sidebar menu as it's way neater and you have to use the override system to have your own theme: 1. Put the code below on your /includes/templates/your_own_theme/common/tpl.header.php
This was an unforgettable experience that i knew when i was developing a website that's hosted on a web server. If you're planning to use php mail function with attachment then you'll certainly upload those attachments temporarily to the web server before sending it to the recipient. These attachments will be stored into the folder specified in 'upload_tmp_dir' directive in php.ini. So, unless you specified another value for the temporary folder, it always point to '/tmp/php_upload' by default. Example: Note: Modifying .htaccess to setup and redirect from '/tmp/php_upload' to your own temporary directory such as 'public/www/temp' folder and gave it chmod 777 to be accessible by anyone won't work. Files by default are stored in the server's default temporary directory, unless another location has been given with the upload_tmp_dir directive in php.ini Two simple tasks to perform:
Normally, you would place your own modified theme on 'sites/all/themes/your_own_theme' and all customized buttons and images should be located on 'sites/all/themes/your_own_theme/images'. This is an exception for logo image because it has to be placed on 'sites/all/theme/your_own_theme/' The code below will display your image located on images folder: <?php $my_static_image= base_path().path_to_theme() . '/images/your_image.png'; ?> <img src="<?php print $my_static_image ?>" /> Meanwhile, to display logo image use the code as following: <img src="<?php print $logo ?>" /></a> The logo variable will automatically spot logo image placed on 'sites/all/themes/your_own_theme/logo.png'. |

PHP - generate full path of web directory