sorry, the original code had a slight synatx error, it should be:
<?php if(isset($_POST["cashondelivery"]) && $_POST["cashondelivery"] != "1") { ?>
<form name="checkout_PP_LI_Hid" action="checkout_success.php" method="post">
<?php } else { ?>
<form name="checkout_PP_LI_Hid" action="https://www.PayPal.com/cgi-bin/webscr" method="post">
<?php } ?>