Wednesday 16 July 2014

auto generate password in php

function randompassword( $length = 8 ) {
    $passchar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
    $password = substr( str_shuffle( $passchar ), 0, $length );
    return $password;
}

$password = randompassword(8);

Sunday 6 July 2014

file upload on click and get image

<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Anil Demo </title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
  <input type='file' onchange="GetUrl(this);" />
    <img id="anil" src="#" alt="Get Your Image" />
</body>
<script>

 function GetUrl(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();

                reader.onload = function (e) {
                    $('#anil')
                        .attr('src', e.target.result)
                        .width(150)
                        .height(200);
                };

                reader.readAsDataURL(input.files[0]);
            }
        }
</script>
</html>

Friday 4 July 2014

India State And City List In csv and xls File

download file csv and xls


Insert Data in mysql with csv file

<?php

 mysql_connect('localhost','root','');
mysql_select_db('Databasename