VF code
<apex:page standardController="Lead" extensions="Leadclass">
<apex:form >
<apex:pageBlock title="lead">
<apex:pageBlockSection title="enter" columns="2">
<apex:inputField label="FirstName" value="{!forleadfirst}"/>
<apex:inputField label="LastName" value="{!forleadlast}"/>
<apex:commandButton value="save" Action="{!mysave}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Class
public class Leadclass {
public static string message{get;set;}
public static string forleadfirst{get;set;}
public static string forleadlast{get; set;}
public Leadclass(Apexpages.StandardController stdcontroller){
}
public static void showgreeting(){
message = 'Welcome';
}
public void mysave(){
Lead newLead = new Lead();
newLead.FirstName = forleadfirst;
newLead.LastName=forleadlast;
newLead.Status = 'Open';
newLead.Phone = '0423465434';
insert newLead;
}
}