Thursday, June 19, 2014

Monday, June 9, 2014

How to upload files on another FTP in PHP

First of all make the connection with ftp host and then login to ftp with username and password.
then If you are logged in the put the files on the ftp with ftp_put function.

$connection = ftp_connect(FTP_HOST );
$login = ftp_login( $connection, FTP_USERNAME, FTP_PASSWORD);
if ($connection AND $login ) {

ftp_put($connection, "REMOTE_FTP", "LOCAL_FILE_PATH", FTP_BINARY);
ftp_close($connection);
}

Need any help contact me.

Thursday, October 10, 2013

Solved - mouseover not working on dynamically generated ul li

$(".CLASS_NAME").on("mouseover", "li", function() {
   alert('now the mouseover will work');
});
 
NOTE : replace CLASS_NAME with your selector. 
 
Read the DOCS! http://api.jquery.com/on/ 

Friday, September 13, 2013

How to replace multiple occurence in a string in javascript

Here is the code :
str = str.replace(/abc/g, '');
 
or you can use this one :
var find = 'abcxyz';
var re = new RegExp(find, 'g');
str = str.replace(re, ''); 

or

function replaceAll(find, replace, str) {
  return str.replace(new RegExp(find, 'g'), replace);
}
 
call the function :  
replaceAll(find, replace, str);

Monday, June 10, 2013

How to Set Permission on Custom module in magento? Solved

I have got the solution, I think It will help you.
Here it is:
Lets say my module name is fabric

Change your /app/code/local/<Namespace>/<Module>/etc/config.xml

        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <Store_Fabric>
                            <title>Swatches</title>
                            <sort_order>10</sort_order>
                        </Store_Fabric>
                    </children>
                </admin>
            </resources>
        </acl>


To :
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                       <fabric translate="title" module="fabric">
                            <title>Swatches</title>
                            <sort_order>10</sort_order>
                            <children>
                                <items module="fabric">
                                   <title>Manage Swatches</title>
                                    <sort_order>0</sort_order>
                                       <action>fabric/adminhtml_fabric</action>
                                </items>
                            </children>
                        </fabric>
                    </children>
                </admin>
            </resources>
        </acl>


Thanks
Vipin Choudhary

Thursday, January 10, 2013

Wordpress Blank Page on Logout - Solved

Check your themes's function.php and remove the blank spaces. Specially from the end of the file.