Results 1 to 9 of 9

Thread: template contact form not working

  1. #1
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default template contact form not working

    Ok, I have a contact form that Im usting with a template that I paid for. I put my script in my submit button and put the email address in my php file and uploaded everything to the web. Now, I does send properly but when I recieve it in my email the name, email, phone, message are all blank and the title is the name of my server. Now heres what I got.


    Submit Button
    Code:
    on(rollOver){gotoAndPlay("s1")}
    on(rollOut, releaseOutside){gotoAndPlay("s2")}
    
    on(release){
    _parent.getURL("contact.php","blank","GET");
    _parent.f1.text = "Name:";
    _parent.f2.text = "E-mail:";
    _parent.f3.text = "Phone:";
    _parent.f4.text = "Message:";
    }
    Frame
    Code:
    stop();
    f1.text = "Name:";
    f2.text = "E-mail:";
    f3.text = "Phone:";
    f4.text = "Message:";
    f1.onSetFocus = function ()
    {
        if (f1.text == "Name:")
        {
            f1.text = "";
        } 
         
    };
    f1.onKillFocus = function ()
    {
        if (f1.text == "")
        {
            f1.text = "Name:";
        } 
    };
    
    f2.onSetFocus = function ()
    {
        if (f2.text == "E-mail:")
        {
            f2.text = "";
        } 
         
    };
    f2.onKillFocus = function ()
    {
        if (f2.text == "")
        {
            f2.text = "E-mail:";
        } 
    };
    f3.onSetFocus = function ()
    {
        if (f3.text == "Phone:")
        {
            f3.text = "";
        } 
         
    };
    f3.onKillFocus = function ()
    {
        if (f3.text == "")
        {
            f3.text = "Phone:";
        } 
    };
    f4.onSetFocus = function ()
    {
        if (f4.text == "Message:")
        {
            f4.text = "";
        } 
         
    };
    f4.onKillFocus = function ()
    {
        if (f4.text == "")
        {
            f4.text = "Message:";
        } 
    };
    Php Script
    Code:
    <?php
    
        $your_name = $_GET['name'];
       	$your_email = $_GET['email'];
        $your_phone = $_GET['phone'];
    	$your_message = $_GET['message'];
    
         // change this to whatever you needed to be.
        $recipient = 'jmw74@tampabay.rr.com';
    
        //you can make it say anything you want
        $subject = 'The Kuhlman Family';
    
         // Do not edit anything else beyond this point
        $headers = 'Content-type: text/html; charset=iso-8859-1';
    
        $content = "<html><head><title>Contact letter</title></head><body><br />";
        $content .= "Name: <b>" . $your_name . "</b><br />";
        $content .= "E-mail: <b>" . $your_email . "</b><br /><hr /><br />";
        $content .= "Phone: <b>" . $your_phone . "</b><br />";
    	$content .= $your_message;
        $content .= "<br /></body>";
    
    
        // The mail() function allows you to send mail.
        mail($recipient,$subject,$content,$headers);
    ?>
    <html>
        <body bgcolor="#282E2C">
            <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;
    font-family:Tahoma;font-weight:bold">
                Your message was sent. Thank you.
            </div>
        </body>
    </html>
    <script>resizeTo(300, 300)</script>
    If anyone could help me or if you need to see the website its http://www.kuhlkids.com and again thanks in advance.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Check out this tutorial. If you still have problems, post back.

  3. #3
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thats cool I will check that out but looking at my code can you tell me what i did wrong?

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by jmw74 View Post
    Thats cool I will check that out but looking at my code can you tell me what i did wrong?
    Your ActionScript isn't written to send the data from your forms to the PHP script. You're simply running the PHP script without sending data...hence the blank outputs.

    Look at that tutorial and pay close attention to the loadAndSend method.

  5. #5
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    just watch the tutorial and I completley understand what I need to do I should do it as a loadvars for send and recieve instead of get this should me easy thanks i will let you know if i run into problems.

  6. #6
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok I did the tutorial exactly how it said and now the email header comes up blank and the name email and message come up blank i did it exactly how it told me to what am i missing?

    heres what I got now

    My Frame
    Code:
    stop();
    
    var senderLoad:LoadVars = new LoadVars();
    var receiveLoad:LoadVars = new LoadVars();
    
    sender.onRelease = function() {
    	senderLoad.theName = theName.text;
    	senderLoad.theEmail = theEmail.text;
    	senderLoad.thePhone = thePhone.text;
    	senderLoad.theMessage = theMessage.text;
    	senderLoad.sendAndLoad("send.php",receiveLoad);
    }
    My Php Script
    Code:
     
    <?PHP
    
    $to = "jmw74@tampabay.rr.com";
    $subject = "Kuhlman Family Website Submission";
    $message = "Name: " . $theName;
    $message .= "\nEmail: " . $theEmail;
    $message .= "\nPhone: " . $thePhone;
    $message .= "\n\nMessage " . $theMessage;
    $headers = "From: $theEmail";
    $headers .= "\nReplyTo: $theEmail";
    
    mail($to,$subject,$message,$headers);
    
    ?>
    now i did it exactly like the tutorial and said to now in my code it dosnt show the message sucess and failed yet I just figured i would get it to email first.
    again thanks in advance

  7. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Your code is right. Some points where the mistake could be:

    1. Your server's level of PHP and/or SMTP support.
    2. The instance names of the text fields you use.
    3. The instance name of the "send" button.

  8. #8
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok the level of php support should be ok but when you say instance of submit and text field do you mean if my instance of submit or text field match whats in the actionscript?

  9. #9
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by jmw74 View Post
    ok the level of php support should be ok but when you say instance of submit and text field do you mean if my instance of submit or text field match whats in the actionscript?
    Yes....the instance name in the properties panel (not the library) should match the field names in your actionscript -- theName, theMessage, etc...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •