Sunday, October 29, 2017

Remove Bitnami Info Page for AWS Cloud

Command for removing 

sudo /opt/bitnami/apps/APPNAME/bnconfig --disable_banner 1


AppName:- your application name (wordpress, joomla, oodeo)

Restart the web server

If apache

sudo /opt/bitnami/ctlscript.sh restart apache

In nginx

sudo /opt/bitnami/ctlscript.sh restart nginx

=---------------------------------------------------------------------------------------

Sometimes error comes "command not found "


Sometimes on this path 

bnconfig preset as bnconfig.disabled

Then first rename the bnconfig file using command

sudo mv /opt/bitnami/apps/APPNAME/bnconfig.disbaled /opt/bitnami/apps/APPNAME/bnconfig

then run command 

sudo /opt/bitnami/apps/APPNAME/bnconfig --disable_banner 1

Again revert the file name
sudo mv /opt/bitnami/apps/APPNAME/bnconfig /opt/bitnami/apps/APPNAME/bnconfig.disbaled

and Restart the web server

Thursday, October 26, 2017

How to use JSON in PHP 4 or PHP 5.1.x

Download JSON Class

<?php
    // Future-friendly json_encode
    if( !function_exists('json_encode') ) {
        function json_encode($data) {
            $json = new Services_JSON();
            return( $json->encode($data) );
        }
    }
    // Future-friendly json_decode
    if( !function_exists('json_decode') ) {
        function json_decode($data) {
            $json = new Services_JSON();
            return( $json->decode($data) );
        }
    }
    ?>

Monday, October 9, 2017

format numbers with 00 prefixes in php?

Prob:-
 Is there any function to have numbers with 5 digit as
 00001, or
 00123… 
this number should be not random but have to increase the value of a previous field.


Ans:-

$n2 = str_pad($n + 1, 5, 0, STR_PAD_LEFT);

Use str_pad() by adding 0s (third parameter) to the left (fourth parameter) of the old number $n incremented by 1 (first parameter) until the length is 5 (second parameter).

Wednesday, August 23, 2017

Only number will taken in text box using javascript

if you want only number will be taken in the text box. so we will use this formet for javascript.


$(document).on('keyup','.numbersOnly', function() {
     this.value = this.value.replace(/[^0-9\.]/g,'');
});