all groups > macromedia flash sitedesign > february 2005 >
You're in the

macromedia flash sitedesign

group:

php in dreamweaver - error


php in dreamweaver - error Meatoaf0123
2/26/2005 6:48:29 PM
macromedia flash sitedesign:
hey,

i need to create a form in dreamweaver to be sent to my email address. i got
some help from kirupa.com and got this code (mailer)(the 5 lines under <?PHP
are not as i am showing them here, they contain email address, site names etc):

<?PHP
$to = "undisclosed";
$subject = "undisclosed";
$headers = "undisclosed";
$forward = 1;
$location = "undisclosed";

$date = date ("l, F jS, Y");
$time = date ("h:i A");

$msg = "Below is the result of your feedback form. It was submitted on $date
at $time.\n\n";

if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}

mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting your request. We will get back to you as
soon as possible.";
}

?>

when i preview in browser it projects the PHP code onto my actual page so that
it is visible, right at the top, but it does not do this when i am working on
it in dreamweaver... HELP!!!
can anyone state a reason why this could be wrong?
Re: php in dreamweaver - error Eric Herlitz
2/28/2005 10:58:51 PM
Im not into php and flash, im using aps and flash instead. But in general
when returning a message to flash from any kind of external documents you
have to use variables. Thus...

echo "Thank you for submitting your request. We will get back to you as soon
as possible.";
---- should be
echo "var1=Thank you for submitting your request. We will get back to you as
soon as possible.";

Do the loadVars (check the help, it works!) and put it out.
yourtextbox.text = var1;

Make sure to enable utf-8 encoding to maximize compatibility!

Good luck!

[quoted text, click to view]

AddThis Social Bookmark Button