I normally use below method whenever I have to submit a form,
<?php
session_start();
//my code
?>
<!DOCTYPE HTML>
<html>
<form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post">
<!--my code -->
</html>
The reason I'm worrying is whether a user will be able to see my php code if I use my whole php code with a html file which goes directly to the user, is there a risk that user will ever be able to see my php code ?