Ir ao conteúdo
  • Cadastre-se

Form? !!! Formulario..... Xiii...


Mibnet

Posts recomendados

Galera, beleza?

Pessoal estou montando um formulário em flash e php mas não consigo fazê-lo funcionar há dias.

Se alguém pude me indicar o erro no código abaixo ou como devo configurá-lo para que funcione eu ficaria grato. O servidor é linux.

valeu :lol:

Code do PHP

<?php 
// I checked the required fields in PHP because it has some nice features like eregi more info: [URL="http://www.php.net"]www.php.net[/URL]
if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $email)) {
$response = 'Email error';
}else if (($length = strlen($name))<1 ){
$response = 'Name required';
} else { // OK let's send off some e-mails
$response = "THANx"; // thus the flash movie advances to the thank you screen
$content="
___________www.advance-media.com_____________________flash_form_________
PAGE REPLY:
E-Mail: $email
Name: $name
Str.: $str
Town: $town
Zip: $zip
Country: $country
Phon: $phon
Age: $age
News: $news
Text:
$comments

We Advance Media
[URL]http://www.advance-media.com[/URL]
________________________________________________________________________
";
// replace the first $name < $email > with the e-mail add of the recipient
mail ("$name < $email >", "page reply", $content, "From: $name < $email > ");
mail ("$name < $email >", "autoresponse",
"___________www.advance-media.com________flash_form_autoresponse________
Thanks for your input,
$name!

This is an autoresponse e-mail.
We Advance Media
[URL]http://www.advance-media.com[/URL]
________________________________________________________________________",
"From: ADVANCE-MEDIA < [EMAIL="[email protected]"][email protected][/EMAIL] > ");
}
echo ("&results=$response"); // send feedback to the flash movie
?>

Code do .fla

// Here is the main part of the script:
// How to create a ROLLOVER effect for dynamic Text input fields
// A solution combining an input field with and normal button causes selection and cursor chaos thus here the solution via hitTest
//
// two sounds for rollOver and pressDown, but here I actually have used one and the same sound twice
plastic = new Sound();
plastic.attachSound("beep");
swishdown = new Sound();
swishdown.attachSound("beep");
plastic1 = 0;
plastic2 = 0;
plasticc = 0;
// these names must be the same names like the dynamic input fields
fieldnam = new Array(0, "name", "str", "zip", "town", "country", "phon", "email", "comments");
// in the same order here the OPERATOR feedback!
awop = new Array(0, "Name?", "Street?", "Zip?", "Town?", "Country?", "Phon?", "E-Mail?", "Text?");
hitf = new Array();
remem = 0;
// some more initial values
results = "OK";
news = "Yes";
age = "under 18";
// sophisticated function to check if Selection.getFocus or hitTest with
// the movie of the same size and location as the input field does show positive results
// no adjustments needed
function walls() {
retfoc = Selection.getFocus();
for (isw=1; isw<9; ) {
if ((retfoc == "_level0."+fieldnam[isw])) {
mgt2t(isw, 3);
if (isw != remem) {
remem = isw;
_root.swishdown.start();
results = awop[isw];
}
clfoc(isw);
}
hitf[isw] = this["swr"+isw].hitTest(_xmouse, _ymouse, true);
if ((hitf[isw] == 1) && (plasticc == 0)) {
_root.plastic.start();
getfoc = eval("swr"+isw+"/:swm");
if (getfoc != 3) {
mgt2t(isw, 2);
}
plasticc = isw;
results = awop[isw];
} else if ((hitf[isw] == 0) && (plasticc == isw)) {
plasticc = 0;
checfocresults();
getfoc = eval("swr"+isw+"/:swm");
if (getfoc != 3) {
bn = "swr" add isw;
mgt2t(isw, 1);
}
}
isw++;
}
menu();
}
// function to reset the focus
function clfoc(clnot) {
for (isow=1; isow<9; ) {
getfoc = eval("swr"+isow+"/:swm");
if ((getfoc == 3) && (clnot != isow)) {
bn = "swr" add isow;
mgt2t(isow, 1);
}
isow++;
}
}
// function to update the OPERATOR
function checfocresults() {
if (remem == 0) {
results = "OK";
} else {
results = awop[remem];
}
}
function mgt2t(a, {
cmem[a-1] = b-1;
/* I used this before to switch a movie clip like a button. Now -> function menu()
tellTarget (a) {
gotoAndPlay(;
}
*/
}
// some more initial values for function menu()
total = 13;
cmem = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// menu() controls the animation effects
function menu() {
for (i=0; i<total; i++) {
if (cmem[i] == 1 and _root["swr" add (i+1)]._currentframe<10) {
_root["swr" add (i+1)].nextFrame();
} else if (cmem[i] == 2) {
_root["swr" add (i+1)].nextFrame();
} else if (cmem[i] == 0) {
_root["swr" add (i+1)].prevFrame();
}
}
}
/*
This basically was the main part of the script.
Make sure to check the actionscript attached to the name movie behind the name input field.
It resets the focus if the user clicks the move without hitting an field...
The News Button is an example for a Checkbox.
The Age Buttons are an example for Radio Buttons.
*/

Essa parte apresenta o erro que o formulario está apresentando, diz que o e-mail está incorreto ou que não tem conexão.

gotoAndPlay("sendloop");
idletime = getTimer();
if (idletime>sendtime+12000) {
// no connection for 12 sec. to mail.php
results = "Offline?";
gotoAndPlay("init");
} else if (results == "THANx") {
// mail has ben send OK
gotoAndPlay("thanks");
cmem[3] = 0;
} else if (results == "Email error" || results == "Name required") {
// required fields
gotoAndPlay("init");
}
walls();
// awaiting server feedback

aí pessoal da um apoio!

Link para o comentário
Compartilhar em outros sites

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...