Thursday, 15 October 2015

PHP - RAND Function to generate Random String

PHP Code for the Random String Generation

<?php

function generateRandomString($length = 10) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}
echo generateRandomString();


?>

Share:

Wednesday, 2 September 2015

html - Darken the image with hover

Live Demo Link  - Click Me

Darken the image on mouse hover

HTML - 
<button class="view_new">
    <div class="a">
    <img src="http://upload.wikimedia.org/wikipedia/en/thumb/2/2a/Burj_Al_Arab,_Dubai,_by_Joi_Ito_Dec2007.jpg/220px-Burj_Al_Arab,_Dubai,_by_Joi_Ito_Dec2007.jpg" alt="Dubai" />
    </div>
</button>
CSS - 
.view_new {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    background-color: white;
}
.view_new .a {
    margin: 10px;
}

.view_new img {
    display: block;
}

.view_new:hover .a {
    background-color: black;
}

.view_new:hover img {
    opacity: 0.4;
}


 
Share:

Wednesday, 1 July 2015

WordPress Theme Development

WordPress Theme Development - Download Default File of WordPress Themes

Download Here


Share:

Monday, 8 June 2015

How to get category name from the product id in woocommerce

How to get category name from the product id in woocommerce.


// Get the product id from the order id -

<?php
$order = new WC_Order( $order->id );

$items = $order->get_items();

foreach ( $items as $itemty ) {
    $product_id = $itemty['product_id'];
}

// then from product id get the category name

$cat_id=get_the_terms( $product_id, 'product_cat' );

foreach ( $cat_id as $ite ) { 
echo  $cat = $ite->name."<br>";
}

?>


Share:

Sunday, 7 June 2015

How to remove Malware From Website and Server via SSH

Websites & Server are infected with the Malwares for Spamming Purpose - SEO SPAM or SPAM EMAILS

If one Website on the Server has Vulnerability and hacker's get access to it. then its will be easy for them to infect all other websites hosted on the server.

Website Hacking Shell is used by them as a backdoor to the server which has the root privileges to make changes or upload new files on server. 

Most of the malwares are BASE64 Encoded or Eval() or FilesMan.

How to locate the Malwares via SSH

Use Command - 
grep -lr --include=*.php "eval(base64_decode" /var/www/

or


grep -lr --include=*.php "FilesMan" /home







Share:

Login/Sign Up Design with social login

Login & Sign Up Design with the Social Login 

Check -







Download Source Code - Click here


Share:

Saturday, 9 May 2015

JQuery Scroll to Top effect



HTML - 

<a href="#" title="Back to top">^Top</a>

JQuery -

jQuery(document).ready(function($){
        $(window).scroll(function(){
            if ($(this).scrollTop() < 200) {
                $('#smoothup') .fadeOut();
            } else {
                $('#smoothup') .fadeIn();
            }
        });
        $('#smoothup').on('click', function(){
            $('html, body').animate({scrollTop:0}, 'fast');
            return false;
            });
    });

 Complete -

<html>
<head>
<script>
jQuery(document).ready(function($){
        $(window).scroll(function(){
            if ($(this).scrollTop() < 200) {
                $('#smoothup') .fadeOut();
            } else {
                $('#smoothup') .fadeIn();
            }
        });
        $('#smoothup').on('click', function(){
            $('html, body').animate({scrollTop:0}, 'fast');
            return false;
            });
    });
<script>
</head>
<body>
    <a href="#" title="Back to top">^Top</a>
</body>
</html>

Share:

Blogger Tutorials

Blogger Templates

d-koder - Web Developer / Security Specialist / Penetration Tester I would like to write tutorials about the issue we use to get while coding something. Hope these small tuts will help developers worldwide. > Website

Interested In -

Html/Css
PHP
Javascript
Jquery
Ajax
JSON
GITHUB