thirtyottsixx
Technical User
Hello... I'm having a bit of trouble posting data to this php script from flash. This is my first try at this.
Here's my PHP Script:
<?
if ($esubmit) {
$qid = db_query("select * from newsletter where email = '$email'");
$num_rows = db_num_rows($qid);
if ($num_rows || $email == "") {
$_SESSION[system_message] = "Sorry, That email address is already in our database.";
} else {
db_query("insert into newsletter (email) values ('$email')");
$_SESSION[system_message] = "Thank you!<br><br> $email has been added to our mailing list.";
}
}
if ($unsubscribe == "true" && $email != "" && $id != "") {
db_query("delete from newsletter where email = '$email' and $id = '$id'");
$_SESSION[system_message] = "$email has been REMOVED from our mailing list.";
}
?>
According to a tutorial I read, I need to set the variable.
So in the first keyframe I have:
email = "";
Then for the button actions I have:
on (release) {
getURL("join.php", "", "POST");
}
I also have the instance name of the button set to esubmit, not sure if that makes a difference.
I uploaded my test.fla here if that helps:
Any responses are appreciated.
Here's my PHP Script:
<?
if ($esubmit) {
$qid = db_query("select * from newsletter where email = '$email'");
$num_rows = db_num_rows($qid);
if ($num_rows || $email == "") {
$_SESSION[system_message] = "Sorry, That email address is already in our database.";
} else {
db_query("insert into newsletter (email) values ('$email')");
$_SESSION[system_message] = "Thank you!<br><br> $email has been added to our mailing list.";
}
}
if ($unsubscribe == "true" && $email != "" && $id != "") {
db_query("delete from newsletter where email = '$email' and $id = '$id'");
$_SESSION[system_message] = "$email has been REMOVED from our mailing list.";
}
?>
According to a tutorial I read, I need to set the variable.
So in the first keyframe I have:
email = "";
Then for the button actions I have:
on (release) {
getURL("join.php", "", "POST");
}
I also have the instance name of the button set to esubmit, not sure if that makes a difference.
I uploaded my test.fla here if that helps:
Any responses are appreciated.