/    Sign up×
Community /Pin to ProfileBookmark

Flash form to php

i am making a smiple flash form with 3 fields, and this below is the code

var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();

sender.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad(“tha-duke.netau.net/public_html/mailscript.php”,receiveLoad);
}

receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop(“success”);
}
else {
_
root.gotoAndStop(“failed”);
}
}

this is then ment to comunicate with my php below

<?PHP

$to = “*********@hotmail.com”;
$subject = “Email from Website Flash Form”;
$message = “Name: ” . $theName;
$message .= “nEmail: ” . $theEmail;
£message .= “nnMessage: ” . $theMessage;
$headers = “From: $theEmail”;
$headers .= “nReply-To: $theEmail”;

$sentOk mail($to,$subject,$message,$hearders);

echo “sentOk=” .$sentOk;

?>

for some reason when i upload the file to my ftp it is not working can anyone help?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@criterion9Apr 01.2009 — Have you tried print_r the _POST and/or _GET to see what is being passed if anything?
Copy linkTweet thisAlerts:
@martswiteApr 01.2009 — Ive spotted two potential problems.

  • 1. I know its optional but pass the third parameter to sendAndLoad (either GET or POST)


  • 2. To return a value to flash you need to echo with a "&" so instead of
    [code=php]echo "sentOk=" .$sentOk;[/code]
    have
    [code=php]echo "&sentOk=" .$sentOk;[/code]


  • EDIT ------------

    Also you access the passed variables like this

    [code=php]
    $name = $_POST['theName'];
    [/code]

    rather than
    [code=php]$name = $theName[/code]

    Hope this helps
    ×

    Success!

    Help @Tornado spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...