Please Help with Flash file PHP Script :?

Hello,

I am having trouble trying to figure out why my friend’s flash email form is not working. I have tried some of everything to try to get the email form to work and I have yet to succeed. One problem that I have encountered is the fact I do not have the original flash file to assist myself with. Is it possible that anyone is able to help me in figuring out what is wrong by just viewing the php code alone? Any help is appreciated. Thank you very much!

The php code is as follows:

[php]

<?php $ToEmail = "[email protected]"; $ToSubject = "Email from Kelzworld Site"; $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nPhone: $Phone\nBudget: $Budget\nEvent: $Event\nAttend: $Attend\nVenue: $Venue\n\nComments:\n$ToComments\n"; mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">"); ?>

[/php]

Is it not sending?

Have you checked that the PHP code is being executed and that the server is allowing the e-mail to be sent?

Yeah, it won’t send an email to the address I have added. Yup I checked the server side to make sure it can be sent.

If you’ve check you can send e-mails with PHP without the flash part then I’m not sure what it could be from that.

Is that the full PHP code you’re using? If so then $ToName isn’t set and neither is $FirstName or $Email. Without $Email it will almost certainly be that which is stopping it from sending.

If that isn’t the full PHP code could you post the rest?

Yup that is the entire PHP code.

Is there a way you can rewrite the code to show me what I am doing wrong? pleasee :slight_smile:

In that case that will most likely be why.

How is the flash form sending the data to PHP?

I’m assuming it will be via a HTTP POST request. To access data that has been posted you use the $_POST global variable like this:

[php]

<?php $FirstName = $_POST['FirstName']; $ToName = $_POST['ToName']; $Email = filter_var($_POST['Email'], FILTER_SANITIZE_EMAIL); // prevent PHP form hijacking by sanitizing the e-mail. $ToEmail = "[email protected]"; $ToSubject = "Email from Kelzworld Site"; $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nPhone: $Phone\nBudget: $Budget\nEvent: $Event\nAttend: $Attend\nVenue: $Venue\n\nComments:\n$ToComments\n"; mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">"); ?>

[/php]

You will need to do the same with the variables in the email body for them to show up but that shouldn’t stop it from sending.

There is a good page on the PHP site about dealing with forms http://php.net/manual/en/tutorial.forms.php. Not about flash but should but similar.

Thank you for all your help, it was appreciated a lot. I will check up on that article as well. Thanks again.

Sponsor our Newsletter | Privacy Policy | Terms of Service