Handful of little updates and fixs

Theres a bunch of little improvemnets i made like using encodeURComponent instead of encodeURI , a few php notice fixs and some other changes  i had to do over the yeras   I didnt mean to commit changing the line pointing to /empty.html   but therest should be good changes,..