in reply to executing a program

Test first the system call. When it work, go ahead with CGI (but it could be a security issue like other monk told you).

Why are you writting first <html>..</html> code ?

See CGI and see start_html, end_html to not have to writting raw html (or use Here Documents)