Dynamic content based on a URL parameter

My suggestion would be to use a custom page template. In your functions file you require a php file that contains the custom template.

require_once 'buy_page_template.php';

and that file declares itself to be a template by containing some commented out text:

<?php
/* Template Name: Buy Page */

Once you’ve uploaded and required that file, a new template appears as a possibility in all your pages in WordPress. You just set the page “buy” to use that template. You can put all the PHP you want into that template, and access the GET variable coming in just like you saw in the other question you cited.

What I do is copy and modify a template file from the theme I’m using.