Customizing AS3 form to add phone field

The AS3 form and php code are posted below. I have modified the code to my desired layout however the phone number will not post to the email. I receive an email with the name and email address but no phone number. Can someone please assist me in resolving this issue. Thanks in advance.

contact.php

<?php
$contact_name = $_POST[‘name’];
$contact_email = $_POST[‘email’];
$contact_phone = $_POST[‘phone’];

if( $contact_name == true )
{
$sender = $contact_email;
$receiver = “demetrius.mcclain@dmcclain.co.cc”;
$client_ip = $_SERVER[‘REMOTE_ADDR’];
$email_body = "Name: $contact_name
Email: $sender
Phone: $contact_phone

IP: $client_ip";
$extra = "From: $sender
" . "Reply-To: $sender
" . “X-Mailer: PHP/” . phpversion();
if( mail( $receiver, $contact_subject, $email_body, $extra ) )
{
echo “success=yes”;
}
else
{
echo “success=no”;
}
}
?>

ContactMain

package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.FocusEvent;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.utils.Timer;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.net.URLLoaderDataFormat;

/**

  • ContactForm Version 1
  • @author activetofocus team
  • @since 2010-02-27
    */
    public class ContactMain extends MovieClip
    {
    //--------------------------------------
    // Variables
    //--------------------------------------
    private var timer:Timer;
    private var urlload:URLLoader;
    private var urlrequest:URLRequest;

/**
* constructor
*/
public function ContactMain()
{

}
//--------------------------------------
// Function
//--------------------------------------

/**

  • data init
    */
    public function init():void
    {
    state_mc.visible = false;

clear_btn.buttonMode = true;
clear_btn.addEventListener(MouseEvent.CLICK,onBtnMouseClickEvent);
clear_btn.addEventListener(MouseEvent.MOUSE_OVER,onBtnMouseOverEvent);
clear_btn.addEventListener(MouseEvent.MOUSE_OUT,onBtnMouseOutEvent);

send_btn.buttonMode = true;
send_btn.addEventListener(MouseEvent.CLICK,onBtnMouseClickEvent);
send_btn.addEventListener(MouseEvent.MOUSE_OVER,onBtnMouseOverEvent);
send_btn.addEventListener(MouseEvent.MOUSE_OUT,onBtnMouseOutEvent);

name_txt.addEventListener(FocusEvent.FOCUS_IN,onTextFocusInEvent);
name_txt.addEventListener(FocusEvent.FOCUS_OUT,onTextFocusOutEvent);

mail_txt.addEventListener(FocusEvent.FOCUS_IN,onTextFocusInEvent);
mail_txt.addEventListener(FocusEvent.FOCUS_OUT,onTextFocusOutEvent);

phone_txt.addEventListener(FocusEvent.FOCUS_IN,onTextFocusInEvent);
phone_txt.addEventListener(FocusEvent.FOCUS_OUT,onTextFocusOutEvent);

}
/**
* check name textfield
/
private function checkNameText():void
{
if(name_txt.text == “”)
{
//name_error.visible = true;
name_txt.text = “Please enter your name!”;
}
else
{
//name_right.visible = true;
}
}
/
*

  • check mail textfield
    */
    private function checkMailText():void
    {
    if(mail_txt.text == “”)
    {
    //mail_error.visible = true;
    mail_txt.text = “Please enter your email!”;
    }
    else
    if(!authenticationEmail(mail_txt.text))
    {
    //mail_error.visible = true;
    mail_txt.text = “Please enter a valid email!”;
    }
    else
    {
    //mail_right.visible = true;
    }
    }

/**

  • check phone text field
    */
    private function checkphoneText():void
    {
    if(phone_txt.text == “”)
    {
    //phone_error.visible = true;
    phone_txt.text = “Please enter phone number!”;
    }
    else
    {

}
}
/**
* check message textfield
/
/
*

  • set click state
    */
    private function setClickState(bool:Boolean = false):void
    {
    name_txt.mouseEnabled = bool;
    mail_txt.mouseEnabled = bool;
    phone_txt.mouseEnabled = bool;
    clear_btn.mouseEnabled = bool;
    send_btn.mouseEnabled = bool;
    }

/**

  • authentication email format
    */
    private function authenticationEmail(str:String):Boolean
    {
    var p:RegExp = /(\w|[_.-])+@((\w|-)+.)+\w{2,4}+/;
    var r:Object = p.exec(str);
    if( r == null )
    {
    return false;
    }
    return true;
    }

//--------------------------------------
// Event
//--------------------------------------
/**

  • clear,send button mouse click event
    */
    private function onBtnMouseClickEvent(evt:MouseEvent):void
    {
    if(state_mc.visible) state_mc.visible = false;
    if(evt.currentTarget == clear_btn)
    {
    name_txt.text = “”;
    mail_txt.text = “”;
    phone_txt.text = “”;

}
else
{

if(name_txt.text !="" && mail_txt.text != "" && phone_txt.text != "")
{
 if(authenticationEmail(mail_txt.text))
 {    
  setClickState();

  state_mc.gotoAndStop(1);
  state_mc.visible = true;

  urlload = new URLLoader;
  urlrequest = new URLRequest( "contact.php" );
  urlrequest.method = URLRequestMethod.POST;

  var dataStr:String = "name=" + name_txt.text
         + "&email=" + mail_txt.text
      + "&phone=" + phone_txt.text;
         
  var urlVar:URLVariables = new URLVariables(dataStr);
  urlVar.dataFormat = URLLoaderDataFormat.TEXT;
  urlrequest.data = urlVar;

  urlload.load(urlrequest);
  urlload.addEventListener(Event.COMPLETE,onLoadCompleteEvent);

  timer = new Timer(2500,1);
  timer.addEventListener(TimerEvent.TIMER_COMPLETE,onTimerCompleteEvent);
  timer.start();
 }
 else
 {
  checkMailText();
 }
}
else
{
 checkNameText();
 checkMailText();
 checkphoneText();
 
}

}
}
/**
* clear,send button mouse over event
/
private function onBtnMouseOverEvent(evt:MouseEvent):void
{
evt.currentTarget.gotoAndStop(2);
}
/
*

  • clear,send button mouse uut event
    /
    private function onBtnMouseOutEvent(evt:MouseEvent):void
    {
    evt.currentTarget.gotoAndStop(1);
    }
    /
    *
  • textField get focus event
    */
    private function onTextFocusInEvent(evt:FocusEvent):void
    {
    if(state_mc.visible) state_mc.visible = false;
    if(evt.currentTarget == name_txt)
    {
    if(name_txt.text == “Please enter your name!”) name_txt.text = “”;
    name_mc.gotoAndStop(2);
    }
    else
    if(evt.currentTarget == mail_txt)
    {
    if(mail_txt.text == “Please enter your email!” || mail_txt.text == “Please enter a valid email!”) mail_txt.text = “”;
    mail_mc.gotoAndStop(2);
    }
    else
    if(evt.currentTarget == phone_txt)
    {
    if(phone_txt.text == “Please enter phone number!”) phone_txt.text = “”;
    phone_mc.gotoAndStop(2);
    }

}
/**

  • textField focus out event
    */
    private function onTextFocusOutEvent(evt:FocusEvent):void
    {
    if(evt.currentTarget == name_txt)
    {
    name_mc.gotoAndStop(1);
    checkNameText();
    }
    else
    if(evt.currentTarget == mail_txt)
    {
    mail_mc.gotoAndStop(1);
    checkMailText();
    }
    else
    if(evt.currentTarget == phone_txt)
    {
    phone_mc.gotoAndStop(1);
    checkphoneText();
    }

}
/**

  • send complete event
    */
    private function onLoadCompleteEvent(evt:Event):void
    {
    timer.removeEventListener(TimerEvent.TIMER_COMPLETE,onTimerCompleteEvent);
    timer.stop();

var backInfo = new URLVariables(evt.currentTarget.data).success;

if(backInfo == “yes” )
{
state_mc.gotoAndStop(3);

name_txt.text  =  "";
mail_txt.text  =  "";
phone_txt.text = "";

}
else
{
state_mc.gotoAndStop(2);
}
setClickState(true);
}
/**

  • timer complete event
    */
    private function onTimerCompleteEvent(evt:TimerEvent):void
    {
    urlload.removeEventListener(Event.COMPLETE,onLoadCompleteEvent);
    timer.removeEventListener(TimerEvent.TIMER_COMPLETE,onTimerCompleteEvent);
    setClickState(true);
    state_mc.gotoAndStop(2);
    }
    }
    }