Wednesday, December 19, 2012

Zen Cart - Change CSS not effective

Never tot that those simple thing we do can cause so much trouble with Zen Cart. huh!

Situation:
I make changes to Stylesheet.css file from my zen cart folder. Working fine in my local machine then i decided to transfer to my hosting. How normally i do, i rename the Stylesheet.css file to any name or just put underscore to the end of the file name (eg: Stylesheet_.css), then transfer the updated Stylesheet.css file. So, inside the folder there will be two css file. I refresh my browser to see the changes but still no change to my template. I clear my browser history/cookies/cache still not working.

Fixed:
The reason that modifications to the Stylesheet.css do not affect the site is because Zen Cart sends BOTH CSS files to the browser. Stylesheet.css is loaded first, then stylesheet_.css — The latest loaded file will have the priority over the files before. And, if a CSS selector appears in multiple files (multiple times in a same CSS file), the one loaded last will always be the one used by the browser.

If you’d like to keep a backup copy of your CSS file in the same folder, just add ‘.bak’ to the end of the filename (well, anything, as long as the filename does not end with .css)

Phew! Alhamdulillah.

Friday, July 20, 2012

Bepang atau Bipang Bijan Kacang

SAYA TERLEBIH DAHULU MEMOHON MAAF jika saya ada berbuat kesalahan, baik yang tidak di sengaja maupun yang di sengaja, semoga kita dapat menjalani ibadah puasa dengan khusyuk, diberkati dan dirahmati Allah S.W.T, insyaallah.

Seterusnya, ni ada nk promote jual2 sikit.. wat mkn2.. kunyah.. :D.. Klu berminat leh la beli online kat http://bepangkacang.blogspot.com/.. 

Wednesday, April 25, 2012

Firefox how to allow seach from address bar


How to do quick search from your browser. As always when u pres alt+T, your cursor will pointed to your address bar. It is most faster if u can just type what ever u want immediately. Some setting for example my firefox already set to use Ask.com. Well i dont really into anything else rather than only Google. So i need to change those to Google. Below will be the step to making Google as the search engine.

Step 1:
Type in about:config in your address bar. it will bring you to a page that says this might void your warrenty, click the button that says I'll be careful, I promise.

Step 2:
Search for browser.search.defaultenginename modify this to Google

Step 3:
Search for browser.search.defaulturl modify this to
http://www.google.com/search?lr=&ie=UTF-8&oe=UTF-8&q=

** Incase you didnt found any when you do search, you can right click the list > New > String. All those changes are immidiate effect. So make sure you write it down (backup) somewhere before make any changes.

Thursday, March 22, 2012

Change documentRoot crom /htdocs/ to D:/

It simple thing actually.. But again, this is for my reference. Im kinda easy to forget thing. I strongly believe im gonna need this again someday. So better i wrote it down before i forgot.

Normal xampp/phptriad/lamp installation, all your system folder will located inside htdocs folder. For example you have a web based application stored in folder "didik". you place in htdocs, then later u can run the application thru http://localhost/didik.

In some certain case u might want to put it out site from htdocs. Example: you dont want to use this url http://localhost/didik, which is having didik at the end. you want it appear only http://localhost. or just direct call using IP - http://172.16.1.100. You can do this either 2 ways:-

1. change directly the documentRoot to new path
    amend this file: C:\xampp\apache\conf\httpd.conf
        #old setting                                                    
        #DocumentRoot "C:/xampp/htdocs"               
        #new setting                                                   
        DocumentRoot "D:/didik/"                               


and

        #<Directory "C:/xampp/htdocs">                    
        <Directory "D:/didik/">                     


2. create a virtual host.
    a) amend this file: C:\xampp\apache\conf\extra\httpd-vhosts.conf. simply add below code
        exactly at the last line.
        NameVirtualHost *
        <VirtualHost *>
                DocumentRoot "D:\didik"
                ServerName localhost
        </VirtualHost>
        <VirtualHost *>
                DocumentRoot "D:\semangat"
                ServerName semangat
                <Directory "D:\semangat">
                        Order allow,deny
                        Allow from all
                </Directory>
        </VirtualHost>
        <VirtualHost *>
                DocumentRoot "D:\berjaya"
                ServerName berjaya
                <Directory "D:\berjaya">
                        Order allow,deny
                        Allow from all
                </Directory>
        </VirtualHost>

     b) amend this file: C:\WINDOWS\system32\drivers\etc\hosts. simply add below code
         exactly at the last line.

127.0.0.1       didik                                                                            
127.0.0.1       semangat                                                                       
127.0.0.1       berjaya                                                                        

     c) what happen now actually, now u have this 3 url

http://didik                                                                               
http://semangat                                                                       
http://berjaya                                                                        

     d)  but this url only work in ur pc. to allow other pc use the link, they must edit the host file same as ur, just changing 127.0.0.1 to ur ip address. if you dont want everytime new user edit their host file, i can suggest u this way. read here


** It is advisable to not change the documentRoot.

Creating multiple services (xampp/iis/apache/tomcat) in one machine

yes you can have multiple installation of any services. the issue will only be the port. So the question is how to differentiated or create different port for each services.

For my case i want to install 2 Xampp into my machine. Basically we can see 2 xampp folder in C: after run installation from xampp.exe.

Just remain the first installation of Xampp as the default. (port 80 and 443).

For second installation of Xampp, change to these file:-
1. C:\xampp_2\apache\conf\httpd.conf - set as below

Listen 0.0.0.0:8080                                                                                                                                         
#Listen [::]:80                                                                                                                                                 
#Listen 80                                                                                                                                                       

ServerName localhost:8080

2.  C:\xampp_2\apache\conf\extra\httpd-ssl.conf

Listen 0.0.0.0:543
#Listen [::]:443
#Listen 443

ServerName localhost:543                                                                                                                              


Now you can restart both your apache and mysql to see the changes. Having multiple services at one time.. :D
http://localhost/
http://localhost:8080/

Monday, February 13, 2012

Copy/Clone/Migrate VM VirtualBox

Pergh this is tough.. seriuosly.. alrite here is the situation:-

Situation
You have install Virtual Machine VirtualBox at your machine (laptop/desktop). You even have create multiple snapshot of the VM. Now you want to Copy/Clone/Migrate the VM into another machine. The word Copy, Clone, Migrate actually bring different meaning in each. To avoid confusion I use the term copying to refer to copying a VM to different host machine and the term cloning to refer to creating a copy on the same host. Well migrate, will be same as copying...

Solution - To Copy/Migrate
1. Make sure NO snapshop available at the VM. If you do, you can delete the previous snapshot. Dont worry, the latest setting will still there as long as you dont delete the "current state" snapshot. Beware of that!!
2. Copy the .vdi file from (C:\Users\Administrator\.VirtualBox\HardDisks) to anywhere you like (even the external HDD).Make sure the VM were closed when you start copy!!
3. The new machine, install the VirtualBox.
4. To start create the new VM to the new machine:- From the VirtualBox window select File → Virtual Disk Manager (Ctrl+D) menu command. Press the Add button and select the copied disk image file (the one you copied just now). From the VirtualBox window select Machine→New… (Ctrl+N) menu command. Work your way through the Create New Virtual Machine wizard till you get to the Virtual Hard Disk page then press the Existing… (not the New…) button and select the disk image VDI file that you previously cloned or copied.
5. That’s it, you should now be able to start and run your new VM

Solution - To Clone
1. Open a Command Prompt window on the host machine.
2. Change to the VirtualBox VDI directory (normally C:\Documents and Settings\\.VirtualBox\VDI).
3. Now run the VBoxManage command with the clonevdi command option. The following example transcript shows the creation of a copy of Ubuntu 8.04.vdi named Ubuntu 8.04 clone.vdi and registers the new disk:

C:\Documents and Settings\srackham\.VirtualBox\VDI> "C:\Program
Files\Sun\xVM VirtualBox\VBoxManage.exe" clonevdi "Ubuntu 8.04.vdi"
"Ubuntu 8.04 clone.vdi"
[press enter here]VirtualBox Command Line Management Interface
Version 2.0.4 (C) 2005-2008 Sun Microsystems, Inc. All rights
reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

C:\Documents and Settings\srackham\.VirtualBox\VDI>

Thursday, January 19, 2012

Batery Kereta Kong

hehe.. happen to me.. sebulan xstart kete.. bile nk start kete langsung xboleh.. nk bukak kete pakai remote langsung xleh.. then after sebulan lepas tu baru nk g servis kete sbb dh terdesak nk pakai kete.. Suspect definately because of the car batery..

Solution.
Cari online servis tukar bateri kereta. Xdak la plak.. Asking fren ada nombor orang yang buat servis supply car batery x.. Alhamdulillah ada.. hehe.. nmpak kat tepi2 jln ada banner tergantung.. mmg servis tiptop.. kol kul 8 mlm ckp, mlm tu kol 10mlm tu gak die sampai. cas dlm 80RM ke 75RM.. xingat dh.. mmg berbaloi.. tunggu ja umah pastu satg die sampai... number tu contact, tgk image dibawah.. hehe



Tag:
Tukar Batery Kereta, Batery Kering, Mencari Bateri Kereta

Thursday, January 12, 2012

Ajax not working in Google Chrome, Firefox

The Idea
-------------------------
Here will be the ajax XMLHttpRequest function. And how i implement this in my page. Only 2 function involve and this can be share by other page. Just matter on how you code your coding.

<script language="javascript">
var xmlhttp=null;
function getXMLHTTP() { //fuction to return the xml http object
xmlhttp=null;
try{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e){
// Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function getAll(strURL,namaDiv) {
//alert (strURL);
var xmlhttp = getXMLHTTP();
if (xmlhttp) {

xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
// only if "OK"
if (xmlhttp.status == 200) {
//alert(namaDiv + '\n' +req.responseText);
document.getElementById(namaDiv).innerHTML=xmlhttp.responseText;
} else {
//alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
xmlhttp.open("GET", strURL, true);
xmlhttp.send(null);
}
}
</script>
<a href="javascript:void(0);" onClick="getAll('ajax.php?jenis=logout&nilai=','divLogin')">Keluar</a>

The problem
-------------------------
My ajax working fine on hyperlink.. But i had the problem with button or any other input. I have retry to edit the ajax function, but the end still failed to work on Crome. Keeping browsing on the net for the solution but still no solution. But luckily..

The Solution
-------------------------
I have found the solution or the reason why the ajax failed to work on Crome & Firefox for the input button. You much ADD the <form name="ajax" method="POST" action=""></form> where the button and other input locate is. Yes just simple as that. This work on me, hope will work on you guys too. Good Luck!


Tag:
Problem with AJAX and Chrome
Ajax XMLHttpRequest Test with Chrome
simple ajax works in IE but not chrome and FF
Problem with ajax onsubmit only in google chrome