Redirect using php

I am using the following code:

<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($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, “From: “.$FirstName.” <”.$Email.">")){
echo “Mail Sent”;
}
else{
echo “Mail not Sent”;
}
?>

In flash Mx I have a mail form which posts this code, in turn producing an email which is working fine.

I decided however to display to the user whether the mail was sent and received by the server.

I therefore need to include a redirection script but I cannot get header() to work and I am not sure how to include java pop up scripts.

Maybe using the alert() function in java would help??

Any ideas??

Why dont you just “echo “Mail Sent”;” back to flash using a dynamic textfield to display the status variable, as in
echo “&status=Mail Sent”; // or not sent…

Would you care to explain in a little more detail, i.e. what format would flash accept the variable in, how would I define the location of the php variable in flash.

I am a bit of a newbie

I take it the get method could be used.

“echo “Mail Sent”;”
prints stuff to the browser,

“echo “&status=Mail Sent”;”
will sent the status variable back to flash,
so in flash you’ll get (on the same timeline you called the php)
a variable “status” containing “Mail sent”.

All you need then is a dynamic textfield,
textfield.text=status;
maybe send the mailer clip to a loading frame on submitting,
and on data, to another frame to display the result (status).

all variables on the same timeline you call a script from are sent to php, php will set up a variable $flashvariable with the same name for each; one thing to note is, flash is not case-sensitive with var names, php IS!
when you echo like above, flash gets the var & the content,
you could also do

if(mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">")){
$status= "Mail Sent";
}
else{
$status= "Mail not Sent";
}
echo "&status="$status;

Sorry to keep on the same subject but the php code you suggested is producing errors:

<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: $Name
Senders Email: $Email

From: $From

Interested In: $InterestedIn

Message Sent:
$Details

$BrowserType
$MediaTypes
$ServerName

$Date";

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

if(mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, “From: “.$Name.” <”.$Email.">")){
$status= “Mail Sent”;
}
else{
$status= “Mail not Sent”;
}
“echo “&status=Mail Sent”;”

?>
</body>
</html>

The error report suggests that there is an unexpected =

Any ideas???