PHP itself needs validation or redirection to another page, i.e. in this example you can make a button Generate a random name! that will display the generated name - but in another page (if you do not want it to be displayed when visiting the page, i.e. you do not want it to be shown at the very start).