Properly encode pos data
Added log function
New .htaccess to protect log