Пример #1
0
} else {
    $ip = $_SERVER['REMOTE_ADDR'];
    //$ip = rand(0, 1000000);
    if ($_SERVER['HTTP_REFERER'] == "http://ynotradio.net/addtop11vote.php" || check_ip($ip) == "true") {
        $count = count($top11picks);
        for ($i = 0; $i < $count; $i++) {
            add_top11_plus1($top11picks[$i]);
        }
        $firstname = mysql_real_escape_string($_POST['firstname']);
        $lastname = mysql_real_escape_string($_POST['lastname']);
        $email = mysql_real_escape_string($_POST['email']);
        $phone = mysql_real_escape_string($_POST['phone']);
        $write_in_value = mysql_real_escape_string($_POST['write_in_value']);
        $contest = $_POST['contest'];
        $newsletter = $_POST['newsletter'];
        if ($write_in_value) {
            write_in($write_in_value);
        }
        if ($contest == "yes" && ($email || $phone)) {
            add_contestant($firstname, $lastname, $email, $phone, $contest, $newsletter);
            echo "<div class=\"center success\">We have received your entry and song selections, thanks!</div>";
        } else {
            echo "<div class=\"center success\">We have received your song entries, thanks!</div>";
        }
        if ($contest == "no" && $newsletter == 'yes' && ($email || $phone)) {
            add_contestant($firstname, $lastname, $email, $phone, $contest, $newsletter);
        }
    } else {
        echo "<div class=\"center error\">Our records show that you have already voted this week.\n<br>\nIf you feel this is a mistake, please contact <a href=\"mailto:josh@ynotradio.net?Subject=Top11%20Voting%20Error\">Josh T. Landow.</a></div>";
    }
}
Пример #2
0
            add_ip($ip, $poll_form);
            echo "<div class=\"row\" id=\"flash\">\n\n      <div class=\"twelve columns top-spacer_20 center success\">Thanks!<br>Your votes have been recorded!</div>\n\n      \n</div>";
        }
    }
}
if ($_POST['contest_form']) {
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $hometown = $_POST['hometown'];
    $contest = $_POST['contest'];
    $newsletter = $_POST['newsletter'];
    if (!$name || !$email || !$phone || !$hometown || !$contest || !$newsletter) {
        $new_contestant = 'missing_values';
    } else {
        $new_contestant = add_contestant($name, $email, $phone, $hometown, $contest, $newsletter, $ip);
    }
    echo "<div class=\"row\">";
    if ($new_contestant == 1) {
        echo "<div class=\"twelve columns top-spacer_20 center success\">Good luck and thanks for voting in Y-Not's 2015 Year End Poll!<br>Find out all the results when we countdown The Top 214 Songs of 2015.<br>December 29<sup>th</sup> -  January 4<sup>th</sup></div>";
    } elseif ($new_contestant == "missing_values") {
        echo "<div class=\"twelve columns top-spacer_20 center error\">Sorry! <br> Seems like you may be missing some value(s), please try again.</div>";
    } else {
        echo "<div class=\"twelve columns top-spacer_20 center error\">Sorry! <br> Seems like there was an error, please try again or contact the webmaster.</div>";
    }
    echo "</div>";
}
/*----- CONTENT ------*/
?>
<div class="row">
  <div class="twelve columns">