Flash/php variable form validation help

I have no idea how to validate certain fields on m flash form. Here is some code. Im not sure what will help.

on the Submit button:


on (release) {
	// send variables in form movieclip (the textfields)
	// to email PHP page which will send the mail
	form.loadVariables("contact_form_samples.php", "POST");

}

on my form_mc:


onClipEvent(data){
	// show welcome screen
	_parent.thanks();
}

I have 3 frames labeled- (frame1)=“contact_form”; (frame 2) = “thanks”; (frame3)=“error”

I have 3 text fields I need validated. Their variable names are “name”, “email”, & “company”.

Any ideas?