Embeding a server-side script in flash

Im Using Flash MX, is the code of the loadvar correct?


 loadVariablesNum ("scripts/solicitud.php", "0", "Post");

and i didnt understand the onLoad thing… :stuck_out_tongue:

sorry…

i deleted the files, cookies etc… form internet tools at IE

and restart the PC but its the same…

i did that because i dont know how to use that trick u post here…

oh man, didnt know is very hard to do this.

Oops, i posted the trick in the wrong thread. :beam: Sorry. :o

:o

no prob…

heh

you know what the prob could be.

i phone the host comp. and they support the mail() funct.

Replace the loadVariables command with this: :slight_smile:

mailHandler = new LoadVars();
mailHandler.email= Email
mailHandler.name= FirstName
mailHandler.comments= ToComments
mailHandler.sendAndLoad(“scripts/solicitud.php”, mailHandler, “POST”);

Hope it works.

h88 8]

should i put all the vars that i got in the form like mailHandler.email = Email?
i got some more…
i just add them?
thhat part (mailHandler.email = Email) is for storing the Vars?

thanks… just that and i give it a shoot

mailHandler = new LoadVars();
mailHandler.email= Email
mailHandler.name= FirstName
mailHandler.comments= ToComments
mailHandler.sendAndLoad(“scripts/solicitud.php”, mailHandler, “POST”);

Your actually posting 3 variables to a php script, if u checked the php script syko gave you, you will notice that these variables are called: email, name, and comments. Before, You was posting wrong variable names, therefore, the php script won’t validiate these variables into the script. Just try the script and tell me how it goes. :goatee:

h88 8]

didnt werk. :*(

Inthe Flash


on (release) {
 if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
 gracias = "Email Incorrecto";
 }
 else if (!FirstName.length) {
 gracias = "Escribe un Nombre";
 }
 else if (!ToComments.length) {
 gracias = "Escribe un Mensaje";
 }
 else {

   mailHandler = new LoadVars();
   mailHandler.email= Email
   mailHandler.name= FirstName
   mailHandler.comments= ToComments 
   mailHandler.sendAndLoad("scripts/solicitud.php", mailHandler, "POST");

 gracias = "Enviando su solicitud...";
 }
}

in the .PHP


<?
$ToEmail = "chidos@hotmail.com";

$ToName = "thediablo";
$ToSubject = "Solicitud de Hosting/Diseño";

$EmailBody = "Enviado por: $FirstName
Email: $Email
Telefono: $tel

Plan de Hosting: $plan
Diseño: $diseno

Forma de Pago: $pago

Mensaje: $ToComments";

$EmailFooter="
Este mensaje fue enviado por: $name desde <a href="http://www.zonahost.net" target="_blank">ZonaHost</a>";

$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "De: ".$FirstName." <".$Email.">");


Print "gracias=Solicitud Enviada, Gracias.";

?>


what could possibly be the error

As i said before, your posted flash variables should be matching the php script variables, change “sendAndLoad” to “send” in the script i gave u as well.

but they are matching no?


$EmailBody = "Enviado por: $FirstName
Email: $Email
Telefono: $tel

Plan de Hosting: $plan
Diseño: $diseno

Forma de Pago: $pago

Mensaje: $ToComments";

those are the vars from FLASH Right?

they are correct.

and i change mailHandler.send right? or .Send?

mailHandler.send

BTW, they are not matching.

mailHandler = new LoadVars();
mailHandler.email/not matching/= Email
mailHandler.name/not matching/= FirstName
mailHandler.comments/not matching/= ToComments
mailHandler.sendAndLoad(“scripts/solicitud.php”, mailHandler, “POST”);

what u mean not matching?

o man lets see…

humm…

mailHandler.Email = Email
mailHandler.FirstName = FirstName

like that h88?

or i dont understand…

Try that:

mailHandler.Email = Email
mailHandler.FirstName = FirstName
mailHandler.ToComments = ToComments

ok wait…
:stuck_out_tongue:

Thanks for ure help man :smiley:

brb… gonna test it…

■■■■…

Parse error: parse error in /www/scripts/solicitud.php on line 9

what does that mean

this is line 9


$EmailFooter="
Este mensaje fue enviado por: $name desde <a href="http://www.zonahost.net" target="_blank">ZonaHost</a>";

maybe is something with the " "s right?

ok i removed some ""s and the email is working now but…

in the email the Name of the guy appers Nobody and the variables dosent apper in the message of the email.

only the text not any var.

and also. when i click send the Print command dosent work. it prints the Thanks… in a new window… not in the dymamicbox with var name gracias


<?
$ToEmail = "chidos@hotmail.com";

$ToName = "Cesar Briones";
$ToSubject = "Solicitud de Hosting/Diseño";

$EmailBody = "Enviado por: $FirstName
Email: $Email
Telefono: $tel

Plan de Hosting: $plan
Diseño: $diseno

Forma de Pago: $pago

Mensaje: $ToComments";

$EmailFooter="
Este mensaje fue enviado por: $name desde zonahost.net";

$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "De: ".$FirstName." <".$Email.">");


Print "gracias=Solicitud Enviada, Gracias.";

?>


Try this instead:


<?
$ToEmail = "chidos@hotmail.com";

$ToName = "Cesar Briones";
$ToSubject = "Solicitud de Hosting/Diseño";

$EmailBody = "Enviado por: $FirstName
Email: $Email
Telefono: $tel

Plan de Hosting: $plan
Diseño: $diseno

Forma de Pago: $pago

Mensaje: $ToComments";

$EmailFooter="
Este mensaje fue enviado por: $FirstName desde zonahost.net";

$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "De: ".$FirstName." <".$Email.">");


echo "gracias=Solicitud Enviada, Gracias.";

?>

im going to cry man :*(
is not working the email is sent but with no vars.

and the echo dosent work