$signupMessage = "Awesome work good job!"; $allowSignup = true; $game = $_GET['game']; $result = "result"; // returned by Sendy on post to DB // if user has cancelled then return home if ($_POST['cancel']) { header("Location: http://bendygames.com"); } // if user has posted then sign them up! if ($_POST['submit']) { $signupMessage = "Thanks for subscribing...!"; $game = $_POST['game']; // use version sent by form instead of passed in URL $postURL = "http://videoswipe.net/sendy/subscribe"; $listID = 'Ft763NYYcZmiRgBJQ8ypV9yA'; // this is the Sendy Bendy Games Signups list ID $data = array( 'name' => "", 'email' => $_POST['email'], 'game' => $game, 'list' => $listID, 'boolean' => "true" ); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ) ); $context = stream_context_create($options); $result = file_get_contents($postURL, false, $context); // check result to decide what happens next... if ($result == "1") { //header("Location: https://videoswipe.net/signupconfirm.php"); $signupMessage = "Thanks! We'll be in touch very soon :)"; $allowSignup = false; } if ($result == "Invalid email address.") { $signupMessage = "Hmmm... something wrong with the email you entered..."; } if ($result == "Already subscribed.") { $signupMessage = "You're already on our list! Sit tight, we'll get in touch as soon as we have some (good) news :)"; $allowSignup = false; } if ($result == "Some fields are missing.") { $signupMessage = " You'll have to enter an email if you want us to keep you in the loop!"; } } ?>
echo $signupMessage; ?>
HOME } ?>