Make login function to be safe from sql and script injection