Log in

View Full Version : template contact form not working



jmw74
05-28-2008, 06:01 PM
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


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


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


<?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.

Medyman
05-28-2008, 10:09 PM
Check out this tutorial (http://www.gotoandlearn.com/player.php?id=50). If you still have problems, post back.

jmw74
05-29-2008, 01:11 PM
Thats cool I will check that out but looking at my code can you tell me what i did wrong?

Medyman
05-29-2008, 03:04 PM
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.

jmw74
05-29-2008, 03:51 PM
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.

jmw74
05-30-2008, 03:19 PM
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


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


<?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

Medyman
05-30-2008, 04:37 PM
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.

jmw74
05-30-2008, 05:01 PM
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?

Medyman
05-30-2008, 11:51 PM
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...