The standard Salesforce web to lead functionality allows a form to be embedded into a company's website to capture information that is then turned into a lead in the company's Salesforce instance. The form is submitted to a servlet that is common to all Salesforce instances and thus, may not be customized besides sending the user to a thank you page that is disconnected from the lead.
Note
For more information on web to lead, visit http://login.salesforce.com/help/doc/en/customize_leadcapture.htm.
In this recipe, we will create a Visualforce page that captures a lead and redirects the user to a personalized thank you page that displays the ID of the lead for future reference. We will then make this page publicly available via an unauthenticated Force.com site.
This recipe requires that you have already completed the Creating a site recipe, as it relies on the custom domain and Force.com site created in that recipe.