473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Email form - trouble connecting the submit button

Hi,

This is my first flash project! It would be great if someone could help me please.

I have purchased a flash template which I have made some alterations to. My biggest alteration is that of adding a contact form to it.

I am comfortable with PHP, so have done the server side code in PHP. but I can't seem to get the button on my form to trigger my code. I've studied many tutorials about this, but none of them are close enough to my own situation for me to make this work.

Here is the PHP code from my file called, 'contact_process.php':

[php]
<?php
// Send the message
$mailfrom="<$_POST[email]>";
$email="trade@snowweb.net";
$subject="RJEN website - Contact form";
Company:$_POST[company]<br><br>
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ". $mailfrom."\r\n";
mail($email,$subject,$data,$headers);

echo "message_sent=ok";
?>
[/php]

Here is the action script that I have in the first frame of the actions layer of my movie:

Expand|Select|Wrap|Line Numbers
  1. stop();
  2.  
  3. var company_var = "";
  4.  
  5. login_button.onRelease = function()
  6. {
  7.  
  8. // Create a new LoadVars instance for the form data
  9. var formData:LoadVars = new LoadVars();
  10. // Initialize formData variables:
  11. var formData.company = company_var;
  12.  
  13. formData.sendAndLoad("http://localhost:87/contact_process.php",_blank,"POST");
  14.  
  15. // Tell the user what's happening.
  16. formData.onLoad = function()
  17. {
  18.  
  19. if(formData.message_sent == "ok")
  20. gotoAndStop(2); 
  21. }
  22. else
  23. gotoAndStop(3); 
  24. }
  25. }
  26.  
  27. }
  28.  
The action script for the button is empty. Is that right? If not, what should I put in it bearing in mind that I already have an event handler in the script above, which is in the 'actions' layer, frame 1.

The .fla file can be downloaded here...

http://dev50.snowweb.net/RJEN_ws_v1.0.fla

and the current .swf can be viewed

http://dev50.snowweb.net/RJEN_ws_v1.0.swf

The form, currently only has one field called company, I'll add the rest once I have the methods sorted.

Thanks, in advance, for your help. I really have spent days on this and never thought it could be such rocket science! I take my hat of to those of you who have mastered Flash out there!

Kind regards

Peter Snow
Jan 25 '07 #1
2 5165
I am new to PHP but the $_POST[email] seems odd I have never seen it used without quotes? i.e.

$email = $_POST['email'];

Have you verified you passed it the email address?

Jim

PS: I tried to download your *.fla but you require a username and password?
Mar 21 '07 #2
sandyw
122 100+
I think you can do it this way.
$EmailTo = "abc@abc.com";


sandy
Mar 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: shortbackandsides.no | last post by:
I've been having trouble preventing users pressing Enter part way down a form so the incomplete form gets submitted. I came up with a possible solution - the code below seems to work in both...
3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
3
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.net / VB page with a Script (submitValues) and a Form. 1. The form has 10 input text and a "Submit" button. 2. The script declares 10 variables. The value of each variable...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
3
by: kirke | last post by:
In php, is there any way to submit button(in a form) makes window pop-up? -INDEX.PHP : <form id="form1" name="form1" method="post" action="vehicle.php"> <input name="submit" type="submit"...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
3
by: eholz1 | last post by:
Hello PHP programmers. I had a brilliant idea on one of my pages that selects some data from my mysql database. I first set the page up to display some info and an image, just one item, with a...
1
by: programming | last post by:
Hi all, i am having trouble trying to write a script to a txt file. I am attempting to seperate each posted item with the deliminater '|', but for some reason i am getting the following...
3
by: nicjones | last post by:
Apologies if these have already been posted, had a quick search but couldn't find anything. Being a bit of a novice to web design I have 2 quick questions if you'd be so kind guys:- ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.