How to add specific script to WordPress webpage that will working with user input and databases

How to add specific script to WordPress webpage that will working with user input and databases