with paypal standard, the forms action posts directly to the paypal servers. The if statement will go around the form tag:
<?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 } ?>