In a web environment, you can't really replicate that directly. In a command line environment, you could. You'd need a HTML form that takes in the data, and then process the rest of it on the server.
For simplicity's sake, I'd look at just doing it in JavaScript unless you actually need to store these results.