# Flash mx and php

**URL:** <https://forum.kirupa.com/t/flash-mx-and-php/10599>\
**Category:** Uncategorized\
**Created:** [January 3, 2003, 11:21pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599 "2003-01-03T23:21:40Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 23, 2003, 8:26pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/21 "2003-01-23T20:26:09Z")

</div>

and one more thing:

> if (@mail($mail\_to,“subject”,  
> "browser= " . $BrowserType . “” .  
> "mediaTypes= " . $MediaTypes)  
> header(“Location: [http://evolt.org](http://evolt.org)”));

has a syntax error:

if (CONDITION  
header(“Location: [http://evolt.org](http://evolt.org)”));

the CONDITION (@mail) is written right next to the header() command… the correct code would be:

```php
if (@mail($mail_to,"subject", 
"browser= " . $BrowserType . "" . 
"mediaTypes= " . $MediaTypes))

header("Location: http://evolt.org"); 

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 23, 2003, 8:30pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/22 "2003-01-23T20:30:56Z")

</div>

I don’t want to display the content of the form, I only want to display whether the form was sent to the server and processed.

Your newest addition should do the trick.

How would php launch a java pop up??

regards

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 23, 2003, 9:31pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/23 "2003-01-23T21:31:00Z")

</div>

The code is producing an unexpected T string error:

\<html\>  
\<body\>  
\<?php  
$ToEmail = "northls@nbkayaking.com";

$ToSubject = “Enquiry”;

$BrowserType = $HTTP\_USER\_AGENT;

$MediaTypes = $HTTP\_ACCEPT;

$ServerName= $REMOTE\_ADDR;

$Date= date("d/F/y

H.i");

$EmailBody = "Sent By: $FirstName  
Senders Email: $Email

Message Sent:  
$ToComments

$BrowserType  
$MediaTypes  
$ServerName

$Date";

mail($ToName." \<".$ToEmail."\>",$ToSubject, $EmailBody, “From: “.$FirstName.” \<”.$Email."\>");

if (@mail($mail\_to,“subject”,  
"browser= " . $BrowserType . “” .  
"mediaTypes= " . $MediaTypes));

header(“Location: \<a href=“[http://evolt.org](http://evolt.org)” target=”\_blank"\>[http://evolt.org](http://evolt.org)\</a\>");

?\>  
\</body\>  
\</html\>

what is the variable $mail\_to, maybe this is the problem, I don’t think I named a variable in flash mail\_to.

Any ideas

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 25, 2003, 9:03pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/24 "2003-01-25T21:03:05Z")

</div>

if (@mail($mail\_to,“subject”,  
"browser= " . $BrowserType . “” .  
"mediaTypes= " . $MediaTypes));

has no sense…

if (CONDITION)  
{  
do something  
}  
else …

what you’ve written is like:  
if (CONDITION) { do nothing }

and about the $mail\_to … if you don’t have any variable in flash with that name, you’ve obviously made a mistake… create that variable or change your code

…

about the fact that you want the user to know if your .php sent the email or not… it’s very simple…

if you want to use header() as I have seen… do something like this:

if (@mail($mail\_to,“subject”,  
"browser= " . $BrowserType . “” .  
"mediaTypes= " . $MediaTypes))  
header(“Location: [http://evolt.org/success.html](http://evolt.org/success.html)”);  
else header(“Location: [http://evolt.org/fail.html](http://evolt.org/fail.html)”);

and use the two pages success.html and fail.html

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 25, 2003, 9:04pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/25 "2003-01-25T21:04:57Z")

</div>

oh, and about the popup window… check for a tutorial on the net for the javascript command window.open() … it should explain you what you want

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 27, 2003, 10:19am UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/26 "2003-01-27T10:19:24Z")

</div>

I really do appreciate your help and feel I am close to a conclusion. Since I last posted I have decided to try and generate a php variable if the mail was sent. I have set up flash, or I am trying to at least, to receive the value of this variable.

The code is as the attachment.

What do you think.

It is generating an error on line 26, something about an extra or uneeded =

Cheers

Could I remove the echo line of the code or is this needed??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 29, 2003, 8:44pm UTC](https://forum.kirupa.com/t/flash-mx-and-php/10599/27 "2003-01-29T20:44:50Z")

</div>

looked over your code and corrected the syntax;

also, i must mention:

```php

//mail($Name." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$Name." <".$Email.">");
//don't use the mail() command twice as it will send two mails...
if(@mail(....

```

which i wrote you in the file…

oh, and also modified the echo() line…

[Previous page](https://forum.kirupa.com/t/flash-mx-and-php/10599.md?page=1)
