Just add this line of code after line 77 and you can remove the repeat region and form from the page entirely.
<?php
mysql_query("UPDATE ProductTable SET SoldColumn = 1 WHERE ProductID IN (SELECT DetailPrintID FROM orderdetails WHERE DetailOrderID = ".$_SESSION['ppCart_OrderID'].")", $ppcat) or die(mysql_error());
?>