Skip to content

Instantly share code, notes, and snippets.

View rcv-legado's full-sized avatar
🔭
just following the arrow of time

Ricardo Cezar Volert rcv-legado

🔭
just following the arrow of time
View GitHub Profile
@rcv-legado
rcv-legado / detectSQLinjection.php
Created March 4, 2017 13:53 — forked from sgnyjohn/detectSQLinjection.php
detect SQL injection - php
<?
/********************************************
detect SQL injection php
ago/2010 - classe testada
********************************************/
class detectSQLinjection {
//******************************************
function ok() {
return count($this->er)==0;
}
@rcv-legado
rcv-legado / stop_sql_injection.php
Created March 4, 2017 13:52 — forked from tracend/stop_sql_injection.php
PHP: Prevent SQL Injection
$sql = safeInput("UPDATE table_name SET field_one='%s', field_two='%s' WHERE id='%s'", $input);
function safeInput($string, $args){
foreach( $input as $key => $value ){
// 'clean' the input
$args[$key] = mysql_real_escape_string($value);
}
// add the statement as the first element of the array
$args[0] = $string;
@rcv-legado
rcv-legado / akinator.js
Created December 17, 2016 22:43 — forked from overjt/akinator.js
Akinator nodejs
var request = require("request");
//script by OverJT, based on https://github.com/devsseb/apinator
var Akinator = function() {
this.url = 'http://api-es2.akinator.com/ws/';
this.session = null;
this.signature = null;
this.onAsk = null;
this.step = 0;
}