further refinement to checkout.php

created mainPHP.js but not used yet.