GetDotted Domains

Viewing Thread:
"Form-to-Mail script for Flash website"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 27/02/09 at 16:27
Regular
Posts: 9
I’m building a Flash website and am having a problem making a form-to-mail script work. Following text input, the submit button is supposed to link with a PHP script. I’ve uploaded this to the server and placed it in the htdocs folder rather than the cgi-bin. Nothing happens when the button is clicked.

I doubt if there’s any reason why the Freeola server would reject the script, so I can only assume I’ve written it wrongly. With only three fields (Name, Company, Email) it should be fairly short and I’m wondering if anyone out there can give me a sample of the basic code. I’d very much appreciate some help.
Fri 27/02/09 at 16:27
Regular
Posts: 9
I’m building a Flash website and am having a problem making a form-to-mail script work. Following text input, the submit button is supposed to link with a PHP script. I’ve uploaded this to the server and placed it in the htdocs folder rather than the cgi-bin. Nothing happens when the button is clicked.

I doubt if there’s any reason why the Freeola server would reject the script, so I can only assume I’ve written it wrongly. With only three fields (Name, Company, Email) it should be fairly short and I’m wondering if anyone out there can give me a sample of the basic code. I’d very much appreciate some help.
Fri 27/02/09 at 16:58
Regular
Posts: 391
Hey

You will need to supply a bit more information first before we can help you fully. Is your site live for us to have a look?

Please post the code (Actionscipt) that is on your Flash button, and the PHP script that you are using to send the mail :)

Thanks!


Also: Google is always your friend..! (At least it is mine) - http://www.google.co.uk/search?q=flash+email+form+php&sourceid=navclient-ff&ie=UTF-8&rls=GGGL,GGGL:2006-20,GGGL:en
Fri 27/02/09 at 17:52
Regular
Posts: 9
Thanks for your reply. I'll follow your Google link before coming back to you. In other words, I'll try to sort it myself without bothering you. Thanks again.
Mon 02/03/09 at 14:08
Regular
Posts: 391
Ok, no problem!

There's lots of tutorials on Flash and how to make typical necessities like contact forms so you should find what you need without too much trouble.

You'll almost never be the only person with a particular problem (of any sort..!), so it's always worth a search on Google for what you're after.

Let me know if you need any further help :)
Tue 03/03/09 at 15:47
Regular
Posts: 9
Hi

I've stripped the php file right down to basics and I'm still having problems. I'd appreciate it if you had a look at it and let me know if there's something amiss. Thanks.

$to = "[email protected]";
$subject = "Motivational Speaking Enquiries";
$body = "Forename: $fnnSurname: $snnTelephone: $tnE-mail: $emailnComments $c";






mail($to, $subject, $body, '[email protected]','-f [email protected]');

?>
Tue 03/03/09 at 20:28
Regular
"Ctrl, Alt, Woof"
Posts: 212
Ardee wrote:
> Hi
....
> $to = "[email protected]";
> $subject = "Motivational Speaking Enquiries";
> $body = "Forename: $fnnSurname: $snnTelephone: $tnE-mail:
> $emailnComments $c";
>
> mail($to, $subject, $body,
> '[email protected]','-f
> [email protected]');
>
> ?>

Hi Ardee,

I've checked your syntax against my own code and notice you have missed the 'From: ' part of the from address. I remember Freeola changing this a while ago to prevent auto-mailers (I think) - a quick check of the Freeola help & support shows the syntax for your mail() should be:

mail($to, $subject, $body, 'From: [email protected]', '-f [email protected]');

Give it a shot.

JTD
Tue 03/03/09 at 22:42
Regular
Posts: 9
Thanks JimtheDog

I'll certainly give it a try.
Wed 04/03/09 at 08:59
Regular
Posts: 9
Here's my latest code following JimTheDog's suggestion. I'm afraid it still doesn't work.

$fn= $_GET["fn"];
$sn= $_GET["sn"];
$t= $_GET["t"];
$c= $_GET["c"];
$email= $_GET["email"];
$to = "motivationalspeaking.co.uk";
$subject = "Motivational Speaking Enquiries";
$body = "Forename: $fnnSurname: $snnTelephone: $tnE-mail: $emailnComments $c";


mail($to, $subject, $body, 'From: [email protected]','-f [email protected]');

?>
Wed 04/03/09 at 09:20
Moderator
"Are you sure?"
Posts: 5,000
Hello - I'm no php (or anything else!) expert but I eventually manage to get my thirdparty formmail scripts running.

I know you said the code you're showing is stripped out - but don't you have to use the sendmail command ('/usr/sbin/sendmail') somewhere along the line?


Ignore me if I'm totally missing the point :¬)





Search Freeola Chat
Wed 04/03/09 at 09:20
Regular
"Ctrl, Alt, Woof"
Posts: 212
Is it genrating an error or just not doing anything?

If you replace your variables with hard code does it work then?

I often use this script to debug:

<script language="JavaScript" type="text/javascript">
alert("<?php echo $message;?>");
</script>


It pops up with a dialogue box showing your variable contents.

Place it before the mail() statement and replace my $message with your variables. My first guess would be that one or more variables is null - but this will soon identify that.

I also note you use $_GET - does Flash use $_GET or $_POST?


JTD

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Unrivalled services
Freeola has to be one of, if not the best, ISP around as the services they offer seem unrivalled.
Best Provider
The best provider I know of, never a problem, recommend highly
Paul

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.