Can someone please lend a hand, might be staring to
long at the screen. This is suppose to write to a .txt
file, all I get is "failed".

ok, this is the AS.

var serverLang:String = "php";
var myVars:LoadVars = new LoadVars();
myVars.onLoad = function() {
        if (myVars.verify == "success") {
                email_txt.text = "Data Saved";
        } else {
                email_txt.text = "Failed Save";
        }
};
submit_btn.onRelease = function() {
        if (!email_txt.length || email_txt.indexOf("@") == -1
|| email_txt.indexOf(".") == -1) {
                email_txt.text = "Invalid Email.";
        } else {
                myVars.userEmail = email_txt.text;
                myVars.sendAndLoad("writeToFile."+serverLang,
myVars, "POST");
        }
};

php for the app:

<?php 
$userEmail = $_POST['userEmail'];
$add = $userEmail;
$open = fopen('emails.txt', 'a');
$write = fwrite($open, $add);

if($write) {
        echo "&verify=success&";
} else {
        echo "&verify=fail&";
}
?> 

PLEASE, some assistance.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to