Nothing fancy, just a personal log with a built in search function so I can recall what is easily forgotten.
Monday, June 24, 2013
Android and Backtrack
Thursday, June 20, 2013
PHP/MySQL ending in JSON that Needs Optimization
function sql_safe($s) { if (get_magic_quotes_gpc()) $s = stripslashes($s); return mysql_real_escape_string($s); }
$flag = "0"; // set flag to good at the start of program
// The user is coming in as the integer id
$user = trim(sql_safe($_POST["User"]));
if ($user == '') $user = 0;
// The member is coming as the text input
$member = trim(sql_safe($_POST["Member"]));
// could do a sub select query, but broke out for clarity.
if ($member != '') {
$sel=mysql_query("SELECT `idmembers` from `a5035822_mya55`.`members` where `handle` = '$member';") or trigger_error ('Error on select handle'.mysql_error(),E_USER_ERROR);
$r1 = mysql_fetch_array($sel);
//echo "r1 is".$r1['idmembers'];
// make sure not trying to delete the owner userid.
// will perform check on the device first with next version of app
if (($r1['idmembers'] != '') && ($r1['idmembers'] != $user)) {
// No composite key on SETS table so no checking for MySQL ret code 1062.
// Separate check to see if row exists first, then delete if it does.
$memberid = $r1['idmembers'];
$checkSet = MySQL_query("select `member` from sets where owner = $user and member = $memberid;") or trigger_error('Failed on check'. mysql_error(), E_USER_ERROR);
$r2 = MySQL_fetch_array($checkSet);
if ($r2['member'] != '') { $del = mysql_query("delete from sets where owner = $user and member = $memberid;") or trigger_error('Failed on delete'. mysql_error(), E_USER_ERROR);
if (mysql_error() == 0) {
$flag = 0;
} else {
$flag = 3; // no row to delete
}} else { $flag = 3; }
} else {
$flag = 3;
$memberid = $user;
}} else { $flag = 5; };
$data = array (
'Flag' => $flag,
);
print(json_encode($data));
Monday, June 10, 2013
NSA, PRISM and Tor
Sunday, May 26, 2013
Technical Sales
Tuesday, May 21, 2013
Saturday, May 11, 2013
Failwords
PayPal Says It's Time to Ditch Passwords and PINs http://shar.es/lSu1g via @CIOonline.
So let me get this straight...Hmmm...Let us no longer trust the individual to come up with secure passwords, but rather standardize account authentication through some oversight organization. Does this sound like a good idea or just another liberal ploy to remove individual responsibility in favor of a larger and much smarter collective that knows what is best.
Thank God for these smart people to help me with my life, because I am too stupid to realize the importance of passwords.