Which is better, form action in the same page or another page ? Sample code
<form action="act.php">
html code
</form>
<form action = "">
html code
</form>
<?php act.php script here ?>
Which one is better 1 Or 2, which provides more security ????
Neither is more secure - both are posting data to a PHP page in the same way (you could argue that you are telling less in the second example as there is no .php
to give away the technology - but it is trivial to tell that it is PHP without this).
If your PHP code validates the input, posting to the same page means it is easier to add the annotations to the same form for the user to correct the details.
Which one is better 1 Or 2
Depends on your design model. I'd personally separate the form to the back-end logic.
Which provides more security
Pretty vague. But neither - from what you've given us. You'd have to do the real security (although obfuscation can be done on client-side, and some filtering using JavaScript) on the back-end.