Flash / PHP mailer stopped working

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
capanno
Registered User
Posts: 5727
Joined: 17 Apr 2004, 02:00
Location: PTA
Contact:

Flash / PHP mailer stopped working

Post by capanno »

Hi guys. Im pulling my hair out here. I have a flash file that posts variables to a php file, which mails it to me. It just stopped working and I don't remember changing anything. :cry:

The php file looks like this.

Code: Select all

<?
    $to = "my@email"; // replace with your mail address
    $s_name = $_POST['sender_name'];
    $s_mail = $_POST['sender_mail'];
    $subject = stripslashes($_POST['sender_subject']);
   
//$body = '';
//foreach ($_POST as $key => $value) { $body.= "_POST[$key] => $value\n";}
//foreach ($_GET as $key => $value) { $body.= "_GET[$key] => $value\n";}

    $body = stripslashes($_POST['sender_message']);
    $body .= "\n\n---------------------------\n";
    $body .= "Mail sent by: $s_name <$s_mail>\n";
    $header = "From: $s_name <$s_mail>\n";
    $header .= "Reply-To: $s_name <$s_mail>\n";
    $header .= "X-Mailer: PHP/" . phpversion() . "\n";
    $header .= "X-Priority: 1";
    @mail($to, $subject, $body, $header)
?>
I tested it with another flash file and on its own, and it works fine.

The flash code is attached to a send button.

Code: Select all

on (release) {
	var sender_mail:String = this._parent._parent.Semail.text;
	var sender_name:String = this._parent._parent.Sname.text;
	var sender_subject:String = this._parent._parent.Ssubject.text;
	var sender_message:String = this._parent._parent.Smessage.text;
	
	loadVariables("http://www.llamafactory.com/flash/mailer.php",this,"POST");
	
}
I traced the sender_mail etc strings and they all have the correct values right before the loadVariables function is run. Is there any reason why this SHOULDNT work?

I made another flash file, and everything is identical except the level for the variables is _root instead of this.

HELP!
Last edited by capanno on 06 Feb 2009, 10:53, edited 1 time in total.
Image
Josh Dies is my hero! |50,000,601.375 forum points
GreyWolf
Registered User
Posts: 4754
Joined: 06 Aug 2003, 02:00
Processor: PHENOM II 945
Motherboard: Asus M4A78
Graphics card: HIS ICEQ 4850 1GB
Memory: 4GB CORSAIR XMS II 1066
Location: , location, location!

Re: Flash / PHP mailer stopped working

Post by GreyWolf »

is there a chance that your service provider changed something in their PHP settings on the server? that's the only reason I can think of.
"Every normal man must be tempted at times to spit on his hands, hoist that black flag, and begin slitting throats."
- H. L. Mancken
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Flash / PHP mailer stopped working

Post by RuadRauFlessa »

capanno wrote:I tested it with another flash file and on its own, and it works fine.
how does the code look in this other flash file?
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
capanno
Registered User
Posts: 5727
Joined: 17 Apr 2004, 02:00
Location: PTA
Contact:

Re: Flash / PHP mailer stopped working

Post by capanno »

Code: Select all

var sender_name:String = "name";
var sender_mail:String = "email@email";
var sender_subject:String = "testmail";
var sender_message:String = "text text text";

loadVariables("http://www.llamafactory.com/flash/mailer.php",this,"POST");
I changed it so it looks exactly the same, and this one works. All this is on the first frame of the flash file. The 'broken' code is on a button with target path of _root.movieclip.movieclip.button
Image
Josh Dies is my hero! |50,000,601.375 forum points
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: Flash / PHP mailer stopped working

Post by RuadRauFlessa »

there has to be a difference somewhere.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
GreyWolf
Registered User
Posts: 4754
Joined: 06 Aug 2003, 02:00
Processor: PHENOM II 945
Motherboard: Asus M4A78
Graphics card: HIS ICEQ 4850 1GB
Memory: 4GB CORSAIR XMS II 1066
Location: , location, location!

Re: Flash / PHP mailer stopped working

Post by GreyWolf »

check that the PHP file is on the directory you referenced in the flash file.
make sure that the file names are correctly specified, including uppercase/lowercase leters.
"Every normal man must be tempted at times to spit on his hands, hoist that black flag, and begin slitting throats."
- H. L. Mancken
maxxis
Moderator Emeritus
Posts: 8307
Joined: 30 Jun 2004, 02:00
Location: ( . Y . )
Contact:

Re: Flash / PHP mailer stopped working

Post by maxxis »

Had a similar problem a while ago.

Firstly your PHP is incomplete

Code: Select all

<?
    $to = "my@email"; // replace with your mail address
    $s_name = $_POST['sender_name'];
    $s_mail = $_POST['sender_mail'];
    $subject = stripslashes($_POST['sender_subject']);
   
//$body = '';
//foreach ($_POST as $key => $value) { $body.= "_POST[$key] => $value\n";}
//foreach ($_GET as $key => $value) { $body.= "_GET[$key] => $value\n";}

    $body = stripslashes($_POST['sender_message']);
    $body .= "\n\n---------------------------\n";
    $body .= "Mail sent by: $s_name <$s_mail>\n";
    $header = "From: $s_name <$s_mail>\n";
    $header .= "Reply-To: $s_name <$s_mail>\n";
    $header .= "X-Mailer: PHP/" . phpversion() . "\n";
    $header .= "X-Priority: 1";
    @mail($to, $subject, $body, $header)
?>
my@email is supposed to be a set to your email addy or a var passed from flash. I take it you posted the virgin PHP code and that your code is actually correct. If not start with that.

After that make sure your page is actually getting the variables from flash.

Code: Select all

<?php

foreach ($_POST as $key => $value) {echo $value;}

?>
This will return all the values sent to PHP by flash.

If you get values then the mail function is not working or your host might have closed the sendmail function in PHP on your hosting which is highly unlikely.

If you are not getting the values in PHP then your flash file is not sending the variables to php.

You flash code seems fine. Funny about the ._parent._parent. Won't _root.mcName.item.value work better? Maybe not. I take it you are loading multiple mc's into a container.

Anyhoo. Im on Gtalk if you need more help.
capanno
Registered User
Posts: 5727
Joined: 17 Apr 2004, 02:00
Location: PTA
Contact:

Re: Flash / PHP mailer stopped working

Post by capanno »

Both pieces of code are identical. I copied the second one from the original. The original just doesn't F-ing work.
Image
Josh Dies is my hero! |50,000,601.375 forum points
maxxis
Moderator Emeritus
Posts: 8307
Joined: 30 Jun 2004, 02:00
Location: ( . Y . )
Contact:

Re: Flash / PHP mailer stopped working

Post by maxxis »

to = "my@email"; // replace with your mail address

Try setting that to an actual email addy.
GreyWolf
Registered User
Posts: 4754
Joined: 06 Aug 2003, 02:00
Processor: PHENOM II 945
Motherboard: Asus M4A78
Graphics card: HIS ICEQ 4850 1GB
Memory: 4GB CORSAIR XMS II 1066
Location: , location, location!

Re: Flash / PHP mailer stopped working

Post by GreyWolf »

hmmm...guys he has said that it STOPPED working, so I assume cap means it was fine, then it stopped.

the $to variable does NOT have to receive a value from the flash file.
"Every normal man must be tempted at times to spit on his hands, hoist that black flag, and begin slitting throats."
- H. L. Mancken
maxxis
Moderator Emeritus
Posts: 8307
Joined: 30 Jun 2004, 02:00
Location: ( . Y . )
Contact:

Re: Flash / PHP mailer stopped working

Post by maxxis »

I know :D

Its quite obvious that the variable are not passed from flash to php
capanno
Registered User
Posts: 5727
Joined: 17 Apr 2004, 02:00
Location: PTA
Contact:

Re: Flash / PHP mailer stopped working

Post by capanno »

Status report

I decided to can the email feature. Even with maxxis helping we couldn't figure it out. Evil Bugs 1 - 0 Me.
Image
Josh Dies is my hero! |50,000,601.375 forum points
GreyWolf
Registered User
Posts: 4754
Joined: 06 Aug 2003, 02:00
Processor: PHENOM II 945
Motherboard: Asus M4A78
Graphics card: HIS ICEQ 4850 1GB
Memory: 4GB CORSAIR XMS II 1066
Location: , location, location!

Re: Flash / PHP mailer stopped working

Post by GreyWolf »

have you tried using a different e-mail address?

I have done dozens of these things, and when I am testing I have to use my yahoo account because my work address does not accept them...

edit* php mails I mean...
"Every normal man must be tempted at times to spit on his hands, hoist that black flag, and begin slitting throats."
- H. L. Mancken
capanno
Registered User
Posts: 5727
Joined: 17 Apr 2004, 02:00
Location: PTA
Contact:

Re: Flash / PHP mailer stopped working

Post by capanno »

The email address is not the problem. I can run the same code in a different part of the flash file with success.
Image
Josh Dies is my hero! |50,000,601.375 forum points
Post Reply