Monday, 2 March 2015

Force a Line Break in a Loooooong Word in a DIV?

This could be added to accepted answer for 'cross-broswer' solution.

CSS

.your_element{
    -ms-word-break: break-all;
    word-break: break-all;

 /* Non standard for webkit */
     word-break: break-word;

    -webkit-hyphens: auto;
       -moz-hyphens: auto;
        -ms-hyphens: auto;
            hyphens: auto;

}

Thursday, 26 February 2015

Get Back To Previous Page

<button type="button" onclick="history.back();">Back</button>

Other Things

back()                 Loads the previous URL in the history list.

forward()          Loads the next URL in the history list.

go()                         Loads a specific URL from the history list.

Side note: this is straight Javascript, not jQuery. There are completely history plugins designed using the jQuery plugin framework, but they are meant to handle ajax and your history (to not break the back button on a single page that behaves as many pages)

Tuesday, 24 February 2015

Clear All Input Fields in a Specific div With JQuery

I have added two buttons in the Fiddle to illustrate how you can insert or clear values in those input fields through buttons. You just capture the onClick event and call the function.


//Fires when the Document Loads, clears all input fields
$(document).ready(function() {
  $('.fetch_results').find('input:text').val('');    
});


//Custom Functions that you can call
function resetAllValues() {
  $('.fetch_results').find('input:text').val('');
}


function addSomeValues() {
  $('.fetch_results').find('input:text').val('Lala.');
}


This function is used to clear all the elements in the form including radio button, check-box, select, multiple select, password, text, textarea, file.


function clear_form_elements(class_name) {
  jQuery("."+class_name).find(':input').each(function() {
    switch(this.type) {
        case 'password':
        case 'text':
        case 'textarea':
        case 'file':
        case 'select-one':
        case 'select-multiple':
            jQuery(this).val('');
            break;
        case 'checkbox':
        case 'radio':
            this.checked = false;
    }
  });

}

Saturday, 21 February 2015

Php String Function

You can create own function in PHP Language but , PHP has many predefined function like string function , array function , numeric function etc.
PHP all String functions as bellow table…

Php Function

PHP functions are comparable to other programming languages. A function is a portion of code which takes one more input in the form of parameter and does some processing and returns a value.

PHP have already built-in functions but PHP gives you option to create your own functions as well.

Readmore.

Friday, 20 February 2015

10 Powerful SQL Injection Tools That Penetration Testers Can Use

 An SQL injection attack is a code injection attack that is used to exploit web applications and websites. It is one of the most common methods for hackers to get into your system. Learning such attacks are important for anyone looking to perform their own exploits. Here are 10 of the most powerful tools that aid in performing SQL Injection attacks.

1. BSQL Hacker

This is a useful tool for both experts and beginners that automates SQL Injection attacks on websites.

2. The Mole

This is an SQL Injection tool that uses the union technique or the boolean query-based technique.

3. Pangolin

This is a penetration testing tool developed by NOSEC. It is aimed at detecting and exploiting SQL injection vulnerabilities on websites.

4. Sqlmap

This is an open source penetration testing tool that security professionals can use. Like the BSQL Hacker tool, this one also automates SQL Injection attacks.

5. Havij

This is an automated SQL injection tool that can be used by penetration testers in order to detect vulnerabilities in web applications and exploit them.

6. Enema SQLi

This is a dynamic penetration testing tool for professionals. It is an auto-hacking software.

7. Sqlninja

This is a tool targeted at exploiting SQL injection vulnerabilities. It uses the Microsoft SQL server as its back end.

8. sqlsus

Written using the Perl programming language, this is an open source penetration testing tool for MySQL Injection and takeover.

9. Safe3 SQL Injector

This is a powerful penetration testing tool, which automates the process of detecting and exploiting SQL Injection vulnerabilities.

10. SQL Poizon

This tool includes php , asp , rfi , lf dorks that can be used for penetration testing.

Monday, 16 February 2015

Schedule tasks in mysql using Event Scheduler

Event Scheduler in MySQL is like a task scheduler which performs database related tasks in MySQL. Event scheduler is available in MySQL version > MySQL 5.1.12.
To use event scheduler, first it should be set ON for your database server either in my.ini or my.cnf file. Even you can enable it on run time by using either of following:
SET GLOBAL event_scheduler = ON;
SET @@global.event_scheduler = ON;
SET GLOBAL event_scheduler = 1;
SET @@global.event_scheduler = 1;

A general syntax is as follows:

DELIMITER $$

-- SET GLOBAL event_scheduler = ON$$     -- required for event to execute but not create    

CREATE /*[DEFINER = { user | CURRENT_USER }]*/ EVENT `<<event_name>>`

ON SCHEDULE
/* uncomment the example below you want to use */

--  run once

   --  AT 'YYYY-MM-DD HH:MM.SS'/CURRENT_TIMESTAMP { + INTERVAL 1 [HOUR|MONTH|WEEK|DAY|MINUTE|...] }

--  run at intervals forever after creation

   -- EVERY 1 [HOUR|MONTH|WEEK|DAY|MINUTE|...]

-- specified start time, end time and interval for execution
   /*EVERY 1  [HOUR|MONTH|WEEK|DAY|MINUTE|...]

   STARTS CURRENT_TIMESTAMP/'YYYY-MM-DD HH:MM.SS' { + INTERVAL 1[HOUR|MONTH|WEEK|DAY|MINUTE|...] }

   ENDS CURRENT_TIMESTAMP/'YYYY-MM-DD HH:MM.SS' { + INTERVAL 1 [HOUR|MONTH|WEEK|DAY|MINUTE|...] } */

DO
BEGIN
    COMMENT 'any sql_statements'
END$$

DELIMITER ;


An example of Event:


SQL>CREATE EVENT e_hourly
    ON SCHEDULE
      EVERY 1 HOUR
    COMMENT 'Clears out sessions table each hour.'
    DO
      DELETE FROM site_activity.sessions;
 
 
 
To check any running event or details of event, following query will be used:


mysql> SHOW EVENTS\G

Some more examples of Events:

CREATE EVENT e_daily
    ON SCHEDULE
      EVERY 1 DAY
    COMMENT 'will run every day'
    DO
      BEGIN
        INSERT INTO site_activity.totals (time, total)
          SELECT CURRENT_TIMESTAMP, COUNT(*)
            FROM site_activity.sessions;
        DELETE FROM site_activity.sessions;
      END |

delimiter ;