here is an example.
http://www.html-form-guide.com/php-form/php-form-submit.html
here is another
http://www.daniweb.com/web-development/php/threads/296613
paypal, has an API for this don't they? all you have to do is use a form, and allow users, to submit the form to paypal url from the web page itself but hey...
update
once you are done with your stuff, you could just do the following,
<script type="text/javascript" language="javascript">
<!--
this.document.yourformtitle.send();
-->
</script>
you could just validate the form with ajax, on your site, once that has passed then redirect as shown above :) changing the action b4 hand :)