Page 1 of 1

Flash Form Mailer

Posted: Mon Jul 28, 2008 8:36 pm
by Bengal
Hi everyone,

I am new to the world of php, and scripting in general so bare with me...

What I am trying to do is connect a nice little form (within a flash file) to a php scrip and have it send the form information to an email address. I am working with a set of templates...

Within the flash file I have 4 text fields.

(Btw, you can see said flash file here: http://www.bengalworks.com/lindsay/ )

Name, Email, Phone Number, and Comments.

WIthin the flash file their respective variables are named: your_name, your_email, your_phone, and message

The send button in the flash file has the following actionscript associated with it:

Code: Select all

on (rollOver) {
    this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
    this.gotoAndPlay("s2");
}
 
 
 
on (release) {
    for (i=1; i<_parent.fields_descriptions.length; i++) {
        if (_parent[_parent.fields_descriptions[i][1]]!=undefined) {
            this[_parent.fields_descriptions[i][1]]=_parent[_parent.fields_descriptions[i][1]]+"&777&"+_parent.fields_descriptions[i][2];
        }
        
    }
 
    this.recipient=_parent.rec;
    i=undefined;
    getURL("contact."+_parent.serv, "_blank", "POST");
    
}

It came with 2 script files... contact.php and contact.asp their contents are listed hereafter:

contact.php:

Code: Select all

<?
Error_Reporting(E_ALL & ~E_NOTICE);
 
 while ($request = current($_REQUEST)) {
    if (key($_REQUEST)!='recipient') {
        $pre_array=split ("&777&",  $request);
        $post_vars[key($_REQUEST)][0]=$pre_array[0];
        $post_vars[key($_REQUEST)][1]=$pre_array[1];
    }
    next($_REQUEST);
}
 
 
 
reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 $message='';
  while ($mess = current($post_vars)) {
    if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {
 
        $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
    }
    next($post_vars);
 }
 
mail($_REQUEST['recipient'], $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
 
?>
<script>
    resizeTo(300, 300);
</script>
and contact.asp:

Code: Select all

 
<%
    for i=1 to 7
        message=Request("message")
    next
        message=message + Request("message")    
        smtpServer = "enter your SMTP SERVER HERE"
        smtpPort = 25
        
 
        name = Request("Your_Name:")
        Set myMail = CreateObject("CDO.Message") 
        myMail.Subject = "from " & name
        myMail.From = Request("Your_Email:")
        myMail.To = Request("recipient")
        myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & message & "</body></html>"
        myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
        myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpPort
        myMail.Configuration.Fields.Update 
        myMail.Send
    
%>

I know that I need to configure something... I don't exacly know how and why the .asp file was included or where it fits in...

Pretty much I have no idea where to go from here. I tried to figure it out but it just does not happen. Any help would be greatly appreciated. Thank you.