I'm not sure I understand the question but below is the form code I used for my stockpicking program. There is no php in it other than the submit action calls the php file it is in, in other words, calls itself.
If I am not mistaken, the onSubmit is a Javascript function. In php you put the file the php is contained in in the action part of the form.
Hope this helps
arelgee at are-l-gee.com
<form method="post" action="<?php echo $PHP_SELF?>">
My name is:
<br> <input type="text" name="YourName">
<p>
My number 1 pick is:
<br> <input type="text" name="Num1Pick">
<p>
<input type="Submit" name="submit" value="Enter my picks">
</form>