Hallo,
habe jetzt auch schon länger gesucht und nix passendes gefunden, aber mir scheint das Problem ist echt verbreitet.
Habe ein Formular in Flash das auch super funktioniert, die Inhalte der Felder werden über PHP ausgelesen. Jetzt soll ich noch 4 Checkboxen einbauen, möchte aber nicht die Komponenten verwenden, da die Datei sonst zu groß wird.
Nun meine Frage(n):
Wie Frage ich meine Checkbox ab? Habe ein MC mit 2 Bildern einmal mit und ohne Haken, jeweils mit einem Stop auf jedem Bild.
Dann habe ich ein Skript auf dem ersten Bild meines Formulares.
Code:
fscommand("allowscale", "false");
//
// set some variables
//
mailform = "mailform.php";
confirm = "Danke, ihre E-Mail ist bei uns eingegangen. Eine Bestätigung wurde an ihre Mailadresse verschickt.";
action = "send";
error1 = "E-Mailadresse bitte angeben";
error2 = "Feld bitte ausfüllen";
//
// and focus on variable fname
//
Selection.setFocus("firma");
//
// validate email function
//
function validate(address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".") ) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
//
// Pflichtfelder form check
//
function formcheck() {
if ((((email == null)) || (email.length<1)) || (email == "valid email required")) {
email = error1;
action = "";
}
if (!validate(email)) {
email = error1;
action = "";
}
if ((firma == null) || (firma == "")) {
firma = error2;
action = "";
}
if ((name == null) || (name == "")) {
name = error2;
action = "";
}
if ((strasse == null) || (strasse == "")) {
strasse = error2;
action = "";
}
if ((comments == null) || (comments == "")) {
comments = error2;
action = "";
}
if ((ort == null) || (ort == "")) {
ort = error2;
action = "";
}
if ((telefon == null) || (telefon == "")) {
telefon = error2;
action = "";
}
if ((messe == null) || (messe == "")) {
messe = error2;
action = "";
}
if ((zeitraum == null) || (zeitraum == "")) {
zeitraum = error2;
action = "";
}
if ((standort == null) || (standort == "")) {
standort = error2;
action = "";
}
if ((land == null) || (land == "")) {
land = error2;
action = "";
}
if ((validate(email)) && (email != error1) && (name != "") && (name != error2) && (comments != "") && (comments != error2)) {
action = "send";
loadVariablesNum(mailform, 0, "POST");
gotoAndPlay("wait");
}
}
stop();
Und dann noch eine PHP:
PHP-Code:
<?
$adminaddress = "info@meinemail.com";
$siteaddress ="http://www.meinewww.com";
$sitename = "Kunde";
//No need to change anything below ...
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");
// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$name = $HTTP_POST_VARS['name'] ;
$firma = $HTTP_POST_VARS['firma'] ;
$strasse = $HTTP_POST_VARS['strasse'] ;
$ort = $HTTP_POST_VARS['ort'] ;
$telefon = $HTTP_POST_VARS['telefon'] ;
$telefax = $HTTP_POST_VARS['telefax'] ;
$internet = $HTTP_POST_VARS['internet'] ;
$messe = $HTTP_POST_VARS['messe'] ;
$zeitraum = $HTTP_POST_VARS['zeitraum'] ;
$standort = $HTTP_POST_VARS['standort'] ;
$land = $HTTP_POST_VARS['land'] ;
$hallennummer = $HTTP_POST_VARS['hallennummer'] ;
$standnummer = $HTTP_POST_VARS['standnummer'] ;
$budget = $HTTP_POST_VARS['budget'] ;
$comments = $HTTP_POST_VARS['comments'] ;
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action == "send") {
//
mail ("$adminaddress","Kontaktformular",
"Ein Besucher von $sitename hat folgende Infomationen angegeben\n
Name: $name
Firma: $firma
Straße: $strasse
PLZ+Ort: $ort
Telefon: $telefon
Telefax: $telefax
Email: $email\n
Internet: $internet
Messe: $messe
Zeitraum: $zeitraum
Standort: $standort
Land: $land
Hallennummer: $hallennummer
Standnummer: $standnummer
Budget: $budget
Kommentar:
------------------------------
$comments
Benutzer Info:
------------------------------
Browser: $HTTP_USER_AGENT
Hostname: $ip
IP Adresse: $REMOTE_ADDR
Datum/Zeit: $date","FROM:$adminaddress" ) ;
//This sends a confirmation to your visitor
mail ("$email","Danke für Ihren Besuch bei $sitename",
"Sehr geehrte(r) $name,\n
Danke für Ihr Interesse an $sitename!\n
Mit freundlichen Grüßen,
$sitename
$siteaddress","FROM:$adminaddress") ;
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Vielen Dank für Ihre E-Mail. Sie erhalten in Kürze eine Bestätigungsmail";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
} //
?>
Wie baue ich jetzt die Checkbox ein?
Vielleicht kann mir jemand helfen.
Grüße
Tanja