Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21
  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    14
    Member #
    15478
    I recently customized a flash template which I purchased. I know almost nothing about Flash, and all I can do really is change the text.

    Can someone please help me get the contact form to work? I don't know what I'm suppose to do with the given code.

    Here is the "mouse release" code for the submit button:

    Code:
     
    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");
     
    }
    The template also has a PHP file called "contact.php" in the main directory, and here is the code for that:

    PHP Code:
    <?
    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>
    There is also a "contact.asp" file located in the main directory, and here are the codes for that:

    Code:
    <%
     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("felix0hu@gmail.com")
      myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & message & "</body></html>"
      myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
      myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = smtpServer
      myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = smtpPort
      myMail.Configuration.Fields.Update 
      myMail.Send
     
    %>
    Could someone please tell me what to do if I just want to change where the message is sent?

    Thanks in advance.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Is your server Apache/Linux or Microsoft/IIS?

    Also, can you post the actionscript from the movie clip that contains the submit button?

  4. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    14
    Member #
    15478
    My hosting says that I'm on a "Windows Platform".

    Here is the full code for the Submit button for the template:

    Code:
     
    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");
     
    }

  5. #4
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    I don't do much ASP at all, but one thing I noticed right away was that you didn't change this value in the ASP file:

    smtpServer = "enter your SMTP SERVER HERE"
    choosy developers choose gif!
    website | paintings | blog

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Quote Originally Posted by FelixHu
    Here is the full code for the Submit button for the template:
    Right, but I need the code from the clip (or scene) containing the button. The code should appear when you click on the appropriate frame in the timeline rather than clicking on the button.

  7. #6
    Junior Member
    Join Date
    Jul 2007
    Posts
    14
    Member #
    15478
    I hoping what this is what you're looking for:

    Code:
     
    rec="ice@template-help.com";
    serv="php";
    var fields_descriptions= Array ("", 
    Array("t1", "your_name", "Your Name:"), 
    Array("t2", "your_email", "Your Email:"),
    Array("t3", "telephone", "Telephone:"),
    Array("t4", "message", "Message:"),
    Array("t5", "field_2", "E-mail:"),
    Array("t6", "field_3", "Address:"),
    Array("t7", "field_4", "fax:")
    );
    for (i=1; i<=fields_descriptions.length; i++) {
    this["k"+i].text=fields_descriptions[i][2];
    }

    I don't do much ASP at all, but one thing I noticed right away was that you didn't change this value in the ASP file:

    smtpServer = "enter your SMTP SERVER HERE"
    I know. I didn't want to change any of this until I knew what to change. The template sort of told me what to change so that it works, however, the "comments" in the code was not very helpful for a beginner.

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Ok, here's what you have to do:

    First, change your movieclip ActionScript to the following (substitute the recipient email address):
    Code:
    rec="YOUR@EMAIL.COM";
    serv="asp";
    var fields_descriptions= Array ("", 
        Array("t1", "your_name", "Your Name:"), 
        Array("t2", "your_email", "Your Email:"),
        Array("t3", "telephone", "Telephone:"),
        Array("t4", "message", "Message:"),
        Array("t5", "your_email2", "Second E-mail:"),
        Array("t6", "your_address", "Your Address:"),
        Array("t7", "your_fax", "Your Fax:")
    );
    Then, hange the ASP to the following (change "mail.transio.com" to your smtp server):
    Code:
    <%
        message = "From: " & Request("your_name") & "<br>" &  _
            "Email1: " & Request("your_email") & "<br>" & _
            "Email2: " & Request("your_email2") & "<br>" & _
            "Phone: " & Request("telephone") & "<br>" & _
            "Fax: " & Request("your_fax") & "<br>" & _
            "Address: " & Request("your_address") & "<br>" & _
            "Message: " & Request("message")
    
        smtpServer = "MAIL.TRANSIO.COM"
        smtpPort = 25
     
        Set myMail = CreateObject("CDO.Message") 
        myMail.Subject = "Contact from " & Request("your_email")
        myMail.From = Request("your_email")
        myMail.To = Request("recipient")
        myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body>" & 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
     
    %>
    Try it out again and let us know...

  9. #8
    Junior Member
    Join Date
    Jul 2007
    Posts
    14
    Member #
    15478
    It works great!

    Thanks. I've plus repped you.

    However, I just have one qualm. Here is the email I got after filling in:

    Name: Felix Hu
    Email Address: emai@address.com
    Phone Number: 123-456-7890
    Company Name: Company
    Message: Message

    This is what I got in the email:

    From: Felix Hu&777&Your Name:
    Email1: emai@address.com&777&Your Email:
    Email2:
    Phone: 123-456-7890&777&Telephone:
    Fax:
    Address:
    Message: Message&777&Message:

    How could I manipulate the .asp code so that the email I get is:

    From: NAME
    Reply To: EMAIL ADDRESS
    Phone number: PHONE NUMBER

    Message: MESSAGE.

    Thanks!

  10. #9
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    The weird display is not the ASP... it's something the guy did in the ActionScript. Change the button script to this:
    Code:
    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]];
            }
        }
        this.recipient=_parent.rec;
        getURL("contact."+_parent.serv, "_blank", "POST");
    }
    You can also cut out the fields you don't want to display in your ASP like this:
    Code:
    <%
        message = "From: " & Request("your_name") & "<br>" &  _
            "Email: " & Request("your_email") & "<br>" & _
            "Phone: " & Request("telephone") & "<br>" & _
            "Message: " & Request("message")
    
        smtpServer = "MAIL.TRANSIO.COM"
        smtpPort = 25
     
        Set myMail = CreateObject("CDO.Message") 
        myMail.Subject = "Contact from " & Request("your_email")
        myMail.From = Request("your_email")
        myMail.To = Request("recipient")
        myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body>" & 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
     
    %>

  11. #10
    Junior Member
    Join Date
    Jul 2007
    Posts
    14
    Member #
    15478
    OK. Thanks so much. I love this forum! Awesome, quick and informative responses!


Page 1 of 3 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:15 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com