SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: Mail form with flash template
-
Jul 28, 2008, 07:14 #1
- Join Date
- Jul 2008
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Mail form with flash template
Hello, I'm new to flash. I purchased a flash template and I'm trying to get the mail form working. On the mail form page, there is a submit button. Here is the action behind the button:
on (release) {
_parent.getURL("contact.php","_blank","GET");
_parent.name="Your name:";
_parent.email="E-Mail:";
_parent.message="Message:";
}
Here is the contact.php file:
<?php
$your_name = $_GET['name'];
$your_email = $_GET['email'];
$your_message = $_GET['message'];
$recipient="greg@mydomain.com";
$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 .= $your_message;
$content .= "<br></body></html>";
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>
After completing the form, and clicking on the submit button, it gives me the option to open a file, it ends up opening the the contact.php file within dreamweaver.
Thank you in advance!!
-
Jul 28, 2008, 08:30 #2
- Join Date
- Nov 2006
- Location
- UK
- Posts
- 2,559
- Mentioned
- 40 Post(s)
- Tagged
- 1 Thread(s)
That's because you're not executing the php file (as it's not on a web server).
-
Jul 28, 2008, 10:47 #3
- Join Date
- Jul 2008
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I wish it was that simple. I have both programs residing on my web server. I've confirmed that my web hosting company has php enabled.
-
Jul 28, 2008, 11:50 #4
- Join Date
- Nov 2006
- Location
- UK
- Posts
- 2,559
- Mentioned
- 40 Post(s)
- Tagged
- 1 Thread(s)
You have a relative url in the flash file:
_parent.getURL("contact.php","_blank","GET");
If you preview the form locally from within dreamweaver, the getURL is looking relative to the embedding html files location i.e : your hard drive file location, not the web url.
If you are previewing the web page live on the web and this is happening, what happens if you directly browse the contact.php url? It'd be very easy to test whether php is enabled: upload a file e.g test.php with
<?php echo('hello'); ?> and see what happens.
-
Jul 28, 2008, 12:05 #5
- Join Date
- Jul 2008
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I did what you recommended, and I'm getting similar results. It brings up the file download window with the options of open, save, cancel. If I select open, it launches Dreamweaver with the test.php file opened.
-
Jul 28, 2008, 12:16 #6
- Join Date
- Jul 2008
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hold off, I believe my problem is my web hosting. Let me find out from them before you do any work.
-
Jul 29, 2008, 09:48 #7
- Join Date
- Jul 2008
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
My hosting plan did not include PHP. I've changed plans and now I'm set to go.
I first checked to make sure that "test.php" worked correctly. It did. I then opened my flash file, filled in the information on the form, and clicked on submit. It looks like it worked properly, but I did not receive the email it was suppose to send. The message that "your message has been sent" was displayed on the screen. Where do you recommend I start looking?
-
Jul 29, 2008, 10:11 #8
- Join Date
- Nov 2006
- Location
- UK
- Posts
- 2,559
- Mentioned
- 40 Post(s)
- Tagged
- 1 Thread(s)
Try this: create a new test.php with the following content, upload and then load the URL in the browser directly.
PHP Code:<?php
error_reporting(E_ALL);
if(mail("youremail@yourdomain","This is the test subject","This is a test message"))
{
echo("mail sent");
}
else
{
echo("mail NOT sent");
}
?>
-
Jul 29, 2008, 10:23 #9
- Join Date
- Jul 2008
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I changed the "test.php" per your recommendations. This is what is displayed when I execute "test."
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in D:\Inetpub\e-byz\test.php on line 3
mail NOT sent
I think I know what this means, but I'll wait for your assistance
-
Jul 29, 2008, 13:37 #10
- Join Date
- Nov 2006
- Location
- UK
- Posts
- 2,559
- Mentioned
- 40 Post(s)
- Tagged
- 1 Thread(s)
Try either inserting this after line 2
PHP Code:ini_set("sendmail_from","youremail@yourdomain.com");
replacing the line
Code:mail("youremail@yourdomain","This is the test subject","This is a test message","From:myemail@mydomain.com\r\n");
Bookmarks