if (param()){ do your error checking here exit; # exit the cgi script if all is correct } HTML code here ... ...