How to create a Link Editor using Javascript or Html or Php?


I am a complete newbie to web development.So please forgive me if i am asking a silly question.

I want to build a tool which can edit links, for example if I paste a link in the tool and press submit button, the tool will add a prefix to the link and then show the prefixed link on the webpage so that I can click that link and go to the page that the link directs me to.

I am not asking to build such a tool for me, I just want to know detailed steps which tell me how can I make it and implement it on my webpage.

Sorry for my bad English