Wednesday, 31 July 2013

What is SQL Injection and How to avoid it?

SQL injection happens if the user input is not properly validated

This is just to play around with the database queries


To Avoid SQL Injection


  • Encrypt sensitive data.
  • Access the database using an account with the least privileges necessary.
  • Install the database using an account with the least privileges necessary.
  • Ensure that data is valid.
  • Do a code review to check for the possibility of second-order attacks.
  • Use parameterised queries.
  • Use stored procedures.
  • Re-validate data in stored procedures.
  • Ensure that error messages give nothing away about the internal architecture of the application or the database.



Difference between PHP4 and PHP5



Advantages of PHP5

Static Methods and Variables

Visitbility
Public , Private and Protected

Abstract Classes

Interfaces

Magic Methods

Final Keyword

__autoload Function

Type Hinting

Exceptions



Ref: http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html

Friday, 14 June 2013

How to check which wordpress theme or plugin is installed

Many a times you want to check which theme is installed on a wordpress site then you can surely use this tool to which theme is installed on that http://whatwpthemeisthat.com/
http://whatwpthemeisthat.com/
It also show installed plugins as well

Tuesday, 4 June 2013

How to get date in javascript in required format


function tgDate(date) {
    var d = new Date(date || Date.now()),
        month = '' + (d.getMonth() + 1),
        day = '' + d.getDate(),
        year = d.getFullYear();

    if (month.length < 2) month = '0' + month;
    if (day.length < 2) day = '0' + day;

    return [day, month, year].join('-');
}

alert(tgDate());



Friday, 17 May 2013

Where is cookie located in windows

In Windows XP


In Window 7

Cookies are located at:
C:\Users\(User-Name)\AppData\Roaming\Microsoft\Windows\Cookies

Wednesday, 8 May 2013

Maximum length validation in MySQL


The following table describes the maximum length for each type of identifier.

Identifier
Maximum Length (characters)
Database
64
Table
64
Column
64
Index
64
Constraint
64
Stored Procedure or Function
64
Trigger
64
View
64
Alias
256 (see exception following table)
Compound Statement Label
16