Sunday 21 April 2019

Display DB Error message php


By default PHP doesn’t show run time error. You will have to set error method as follows


// first set general PHP error reporting
// in order to be sure we will see every error in the scriptini_set('display_errors',1);error_reporting(E_ALL);
/*** THIS! ***/mysqli_report(MYSQLI_REPORT_ERROR MYSQLI_REPORT_STRICT);/*** ^^^^^ ***/$db $mysqli = new mysqli($host$user$pass$database);
$res $db->query("apparently not valid SQL string");$res->fetch_assoc();

Sunday 31 March 2019

File preview before upload : HTML

<html>
<head>
     <title>File upload preview</title>
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
     <style>
     .fileUpload {
        position: relative;
        overflow: hidden;
        margin: 10px;
        margin-top: 0px;
    }

    .fileUpload input.upload {
           position: absolute;
           top: 0;

Friday 29 March 2019

Check empty file using jquery

When you use file control from the input tag then for validation purpose you need to check the file name. if no file is selected then an error message should be displayed. This post will help you to achieve the same. When a user doesn’t select a file and an attempt is made to read file name then JS engines throw an exception which must be caught otherwise you will not be able to read and validate the empty file.

Wednesday 27 March 2019

Sketch effect to a picture using photoshop




  1. open a picture in photoshop and make a duplicate layer by pressing Cntl+J

  2. Select huge saturation from create or adjustment layer tool