You put Javascript code in HTML code. Then set an event trigger that will cause a message box(or prompt) to appear. Then set your PHP code to process the textbox/messagebox/prompt using $_POST.
I don't know whether you know any Javascript as you have not stated but check out documentation on Javascript here:
http://www.w3schools.com/js/default.asp
PHP $_POST:
http://www.w3schools.com/php/php_post.asp
http://php.net/manual/en/reserved.variables.post.php
You have not stated what exactly you know or don't know.