Where do you get your list of products from? Is it from a database? or do you have an HTML list of products?
The only way to have PHP display the products is if it reloads the page, much like how devinemke was describing it.
$function = $_REQUEST['function'];
if (isset($function)) {
// Use your code to display the products
} else {
// all the stuff with the "button" to display products.. with
echo "<input type=\"hidden\" name=\"function\" value=\"1\">";
}