[ arpixone @ 16.06.2010. 09:58 ] @
Postovanje vec se danima mucim sa problemom, koji za sad nemogu da resim, pretrazio sam razne forume i jednostavno moje znanje vise ne dopire do resenja... MAGLA u mozgu... :(

naime rec je o Contact aplikaciji koji je pravlejn u AS3, Kad se ispuni Flash formular AS3 jednostavno nezna da posalje podatke PHP u...
A PHP bi trebalo da formirane podatke informacije salje na moj mail. ka sto su ime, e-mail, i comentar....
stalno dobijam sledecu gresku u Flash CS5 ici pri testiranju...

evo postavicu kod:

AS3:


var errorsFormat:TextFormat = new TextFormat();
errorsFormat.color = 0xFF0000;

var waitingFormat:TextFormat = new TextFormat();
waitingFormat.color = 0x339900;

var successFormat:TextFormat = new TextFormat();
successFormat.color = 0x3366FF;


processing_mc.visible = false;


var variables:URLVariables = new URLVariables();


var varSend:URLRequest = new URLRequest("httpppp://127.0.0.1/xxxxx/contact_parse.php"); ///namerno xirano
varSend.method = URLRequestMethod.POST;
varSend.data = variables;


var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);



function completeHandler(event:Event):void{

processing_mc.visible = false;

name_txt.text = "";
email_txt.text = "";
msg_txt.text = "";

status_txt.text = event.target.data.return_msg;
status_txt.setTextFormat(successFormat);
}


submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);


function ValidateAndSend(event:MouseEvent):void{


if(!name_txt.length) {
status_txt.text = "Please enter your name.";
status_txt.setTextFormat(errorsFormat);
} else if(!email_txt.length) {
status_txt.text = "Please enter an email address";
status_txt.setTextFormat(errorsFormat);
} else if(!validateEmail(email_txt.text)) {
status_txt.text = "Please enter a VALID email address";
status_txt.setTextFormat(errorsFormat);
} else if(!msg_txt.length) {
status_txt.text = "Please enter a message.";
status_txt.setTextFormat(errorsFormat);
} else {


processing_mc.visible = true;


variables.userName = name_txt.text;
variables.userEmail = email_txt.text;
variables.userMsg = msg_txt.text;


varLoader.load(varSend);


status_txt.text = "Waiting for server connection...";
status_txt.setTextFormat(waitingFormat);

}
}



function validateEmail(str:String):Boolean {
var pattern:RegExp = /(\w|[_.\-])[email protected]((\w|-)+\.)+\w{2,4}+/;
var result:Object = pattern.exec(str);
if(result == null) {
return false;
}
return true;
}




i PHP cod koji bi trebao da prima poslate informacije i da salje na moj privatni mail sa web sajta:



<?

$senderName = $_POST['userName'];
$senderEmail = $_POST['userEmail'];
$senderMessage = $_POST['userMsg'];


$senderName = stripslashes($senderName);
$senderEmail = stripslashes($senderEmail);
$senderMessage = stripslashes($senderMessage);


$to = "[email protected]"; //namerno sam ovako napisao
$from = "$senderEmail";
$subject = "Contact from your site";



$message = "Message from your website:

Their Name: $senderName

Their Email: $senderEmail

Their Message is below:

$senderMessage";


$headers = "From: $from\r\n";
$headers = "Content-type: text\r\n";
$to = "$to";

mail($to, $subject, $message, $headers);


$my_msg = "Thanks $senderName, your message has been sent.";

echo "return_msg=$my_msg";

exit();
?>


sajt mi trenutno radi na localnoj masini zato je 127.0.0.1 XAMPP server....

PHP sam provereno proverio i to radi ali ovaj kod ovde sto sam postavi nece jednostavno...

Greska sto se ispisuje je:

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()



Unapred zahvalan na svaki odgovor!!!!!!!