ok, i’m trying to make a “check function” for an email form…
This is the code:
frame 1:
[COLOR=Red]System.useCodepage=true;
name = “”;
email = “”;
input = “”;
input1.tabIndex = 1;
input2.tabIndex = 2;
input3.tabIndex = 3;
error = “forget something?”;
function formcheck() {
if ((name == null) || (name == “”)) {
name = error;
action = “”;
}
if ((input == null) || (input == “”)) {
input = error;
action = “”;
}
if ((name != “”) && (name != error) && (input != “”) && (input != error)) {
name = input1.text;
email = input2.text;
webb = input3.text;
gotoAndPlay(“sending”);
}
}
stop();[/COLOR]
submit button on frame 1:
[COLOR=Red]on (release){
formcheck ();
}[/COLOR]
frame 10:
[COLOR=Red]myData = new LoadVars();
myData.load(“mail.php” + “&name=” + name + “&email=” + email + “&input=” + input, myData, “POST”);
myData.onLoad = function () {
if (myData.result == “okay”) {
_root.enter.level1.motion.contact_mc.cont_level2_mc.contactform_mc.gotoAndStop(“good”);
} else {
gotoAndStop(“error”);
}
}
stop();[/COLOR]
and this is the PHP:
<?php
[COLOR=Red]$name = $_GET[“name”];
$email = $_GET[“email”];
$input = $_GET[“input”];
if (!isset($name) || !isset($input) || empty($name) || empty($input)){
print “&result=Fail”;
print “&errorMsg=” .urlencode(“forgett something?”);
exit;
}
$send = “info@frameset.se”;
$subject = “Mail från hemsidan”;
$headers = "Från: " . $_POST[“name”];
$headers .= “<” . $_POST[“email”] .">
";
$headers .= "svara: " . $_POST[“email”];
$input = $_POST[“input”];
$input = strip_tags("$input");
$headers = strip_tags("$headers");
mail($send, $subject, $input, $headers);
print “&result=okay”;
exit;
?>[/COLOR]
But it just goes to the “error” frame (frame 10)!!! what am i missing??!!? :h: