Web Hosting Forum | Lunarpages
News: April 3, 2008 - New Contest! - Win 5 Years of Hosting and $1,000!
June 30, 2008 - Submit Your Site for the July 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 09, 2008, 02:01:45 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Flash contact form and php- can someone identify a problem? (edited 4/2/08)  (Read 3929 times)
amysdaddy
Newbie
*
Offline Offline

Posts: 1


« on: March 31, 2008, 08:12:18 AM »

I know this has been addressed in the past, and I have tried to follow the examples, but I cannot get this flash contact form to work. Here is the flash code:

fscommand ("allowscale", "false");
fname1.tabIndex = 1;
email1.tabIndex = 2; 
comments1.tabIndex = 3;
mailform = "mailform.php";
confirm = "sending ..."
action = "send";
Selection.setFocus("fname");
function validate (address) {
   if (address.length>=7) {
      if (address.indexOf("@")>0) {
         if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
            if (address.lastIndexOf(".")<(address.length-2)) {
               return (true);
            }
         }
      }
   }
   return (false);
}
function formcheck () {
   if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
      email = "ERROR! Address not valid";
      action = "";
   }
   if (!validate(email)) {
      email = "Address not valid";
      action = "";
   }
   if ((((fname == null)) || (fname.length<1)) || (fname == "ERROR! Address not valid")) {
      fname = "Name required";
      action = "";
   }
   
   if ((validate(email)) && (email != "ERROR!") && (fname != "")) {
      action = "send";
      loadVariablesNum (mailform, 0, "POST");
      gotoAndPlay ("wait");
   }
}
stop ();


Here is the php code:


// Enter your contact email address here
$adminaddress = "xxx@xxx.net";

// Enter the address of your website here include http://www.
$siteaddress ="http://www.xxx.com";

// Enter your company name or site name here
$sitename = "Contact Form";

/*******************************************************

No need to change anything below ...

*******************************************************/

$date = date("m/d/Y H:i:s");

if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);


if ($action != ""):
mail("$adminaddress","Info Request",
"A visitor at $sitename has left the following information\n
Name: $fname
Email: $email
The visitor commented:
------------------------------
$comments

Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time:  $date","FROM:$adminaddress");

mail("$email","Thank You for using $sitename",
"If you have requested information, I will respond as soon as possible.\n
Have a healthy day!\n
xxxxx
$sitename,"FROM:$adminaddress");

endif;

?>


(added 4/2/08)

The flash code above is in the first keyframe. There are 4 additional keyframes with code as follows:

Keyframe: Wait
gotoAndStop(1);

Keyframe: Loop
loadVariables (mailform, 0);
answer = confirm ;

Keyframe: a
if (answer != confirm) {
     goAndPlay ("done");
}

Keyframe: done
goAndPlay ("loop")


When  the "send" button is pressed, the status bar shows "transferring data from xxx.com..." and the form show "status:sending" and does not change from there. No emails are sent.

Any input would be greatly appreciated.
« Last Edit: April 02, 2008, 08:12:35 AM by amysdaddy » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM