| Server IP : 104.21.21.239 / Your IP : 216.73.216.55 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/banners/public_html/bway/ |
Upload File : |
<?php
require_once __DIR__ . '/db/mysql_bootstrap.php';
// Read DB connection
$dsnRead = 'mysql:host=amazonaurora.cluster-ro-cemzxojvmybt.us-east-1.rds.amazonaws.com;dbname=amazonrds;charset=utf8mb4';
$userRead = 'admin';
$passRead = 'xxatN6Lb8Kbwb9MiU1At';
// Write DB connection
$dsnWrite = 'mysql:host=amazonaurora.cluster-cemzxojvmybt.us-east-1.rds.amazonaws.com;dbname=amazonrds;charset=utf8mb4';
$userWrite = 'admin';
$passWrite = 'xxatN6Lb8Kbwb9MiU1At';
// ========== RULES MODE ==========
if (isset($_GET['rules'])) {
if (!is_numeric($_GET['rules'])) {
exit;
}
$rulesId = (int) $_GET['rules'];
$pdo = new PDO($dsnRead, $userRead, $passRead, mysqlPdoOptions([PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]));
$stmt = $pdo->prepare("SELECT contestterms FROM contestmain WHERE id = :id");
$stmt->execute([':id' => $rulesId]);
$rules = $stmt->fetch(PDO::FETCH_ASSOC);
if ($rules) {
echo $rules['contestterms'];
}
// ========== SUBMIT MODE ==========
} elseif (isset($_GET['submit'])) {
if (!is_numeric($_GET['submit']) || strlen($_GET['submit']) > 10) {
exit;
}
$submitId = (int) $_GET['submit'];
// Validate email
$email = isset($_POST['email']) ? $_POST['email'] : '';
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo 'Error, you must enter a valid email address. <a href="javascript:history.back()" class="previous">Back...</a>';
exit;
}
$name = isset($_POST['name']) ? $_POST['name'] : '';
$entry = isset($_POST['entry']) ? $_POST['entry'] : '';
$address = isset($_POST['address']) ? $_POST['address'] : '';
$zipcode = isset($_POST['zipcode']) ? $_POST['zipcode'] : '';
// Insert into contestmaster
$pdoWrite = new PDO($dsnWrite, $userWrite, $passWrite, mysqlPdoOptions([PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]));
$stmt = $pdoWrite->prepare("INSERT INTO contestmaster (name, entry, address, email, contestid, currentdatetime, zipcode)
VALUES (:name, :entry, :address, :email, :contestid, :currentdatetime, :zipcode)");
$stmt->execute([
':name' => $name,
':entry' => $entry,
':address' => $address,
':email' => $email,
':contestid' => $submitId,
':currentdatetime' => date('Y-m-d H:i:s'),
':zipcode' => $zipcode,
]);
?>
<style>
body {
background-color: #000 !important;
color: #ffffff !important;
padding:20px;
}
</style>
<center>
<img src="https://cloudimages.broadwayworld.com/2017/broadwayworld-new-retina.png" style="width:150px;height:auto;">
<br><br>
<b>
Thank you, your entry was received! Earn more entries below:
</b>
<p></p>
<?php
// Get article info for sharing
$pdoRead = new PDO($dsnRead, $userRead, $passRead, mysqlPdoOptions([PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]));
$stmt = $pdoRead->prepare("SELECT seo_friendly, title, blurb
FROM bway_bww.columntable
INNER JOIN contestmain ON columntable.id = contestmain.articleid
WHERE contestmain.id = :id");
$stmt->execute([':id' => $submitId]);
$contestInfo = $stmt->fetch(PDO::FETCH_ASSOC);
$seoFriendly = $contestInfo['seo_friendly'];
$title = $contestInfo['title'];
$blurb = $contestInfo['blurb'];
$encodedSeo = urlencode($seoFriendly);
$encodedTitle = urlencode($title);
$encodedBlurb = urlencode($blurb);
$titleHtml = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
$seoHtml = htmlspecialchars($seoFriendly, ENT_QUOTES, 'UTF-8');
?>
<table>
<tr><td style="padding:4px;">
<b>Visit & like BWW on Facebook</b> +1
</td><td style="padding:4px;"><iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fbroadwayworld&width=450&layout=standard&action=like&size=small&show_faces=false&share=false&height=35&appId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
</td></tr>
<tr><td style="padding:4px;">
<b>Follow BWW on X</b> +1
</td><td><a href="https://twitter.com/broadwayworld?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @broadwayworld</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></td></tr>
<tr><td style="padding:4px;"> <b>Follow BWW on Instagram</b> +1
</td><td><a href="https://www.instagram.com/accounts/login/?next=%2Fofficialbroadwayworld%2F&source=follow" target="+new"
style=" border: 1px solid transparent;
background-color: #3897f0;
background-color: rgba(var(--h5f,56,151,240),1); border-radius: 4px;
color: #fff;
color: rgba(var(--eca,255,255,255),1);
position: relative;padding:3px;"
>Follow</a></td></tr>
<tr><td style="padding:4px;">
<b>Share link on Facebook</b> +1
</td>
<td>
<a title="Share this post/page"
href="https://www.facebook.com/sharer/sharer.php?u=https://www.broadwayworld.com/article/<?= $seoHtml ?>&title=<?= $encodedTitle ?>&caption="e=&description=<?= $encodedBlurb ?>"
target="_blank">
<img src="https://cloudimages.broadwayworld.com/New-Facebook-share-button.png" style="height:30px;"
alt="Share on Facebook" /></a>
</td>
</tr>
<tr><td style="padding:4px;">
<b>Share on X</b> +1
</td>
<td>
<a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.broadwayworld.com%2Farticle%2F<?= $seoHtml ?>&text=<?= $encodedTitle ?>" style=" border: 1px solid transparent;
background-color: #00acee;
color: #fff;
color: rgba(var(--eca,255,255,255),1);
position: relative;padding:3px;">
Tweet
</a>
</td>
</tr>
<tr><td style="padding:4px;">
<b>Share on Threads</b> +1
</td>
<td>
<a href="https://threads.net/intent/post?url=https%3A%2F%2Fwww.broadwayworld.com%2Farticle%2F<?= $seoHtml ?>&text=<?= $encodedTitle ?>" style=" border: 1px solid transparent;
background-color: #8A2BE2;
color: #fff;
color: rgba(var(--eca,255,255,255),1);
position: relative;padding:3px;">
Threads
</a>
</td>
</tr>
</table>
</center>
<?php
// ========== DEFAULT FORM MODE ==========
} else {
if (!isset($_GET['id']) || !is_numeric($_GET['id']) || strlen($_GET['id']) > 10) {
exit;
}
$contestId = (int) $_GET['id'];
// Dark mode styles
if (isset($_GET['dark']) && $_GET['dark'] === 'on') {
?>
<style type="text/css">
@charset UTF-8;
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
margin: 0 !important;
padding: 0 !important;
font-display: auto !important;
background-color: #000 !important;
color: #e0e0e0 !important;
}
a {
color: #bb86fc !important;
text-decoration: none !important;
font-size: 14px !important;
font-weight: 500 !important;
}
img {
max-width: 100% !important;
height: auto !important;
}
a:hover {
color: #ff79c6 !important;
}
.cp {
float: left !important;
padding-right: 10px !important;
height: 80px !important;
width: 80px !important;
}
input {
border-width: 1px !important;
border-style: solid !important;
border-color: #bb86fc !important;
background-color: #1f1f1f !important;
color: #e0e0e0 !important;
}
.input {
border-width: 1px !important;
border-style: solid !important;
border-color: #bb86fc !important;
background-color: #1f1f1f !important;
color: #e0e0e0 !important;
}
input[type="submit"] {
background-color: #a40221 !important;
box-shadow: inset 0 0 0.04px 3.96px rgba(0,0,0,.27) !important;
width: 221px !important;
height: 51px !important;
border: none !important;
outline: none !important;
color: #fff !important;
font-size: 21px !important;
font-weight: 700 !important;
}
.link-pad {
padding: 20px;
}
form {
padding:20px;
}
</style>
<?php
}
// Gatsby special mode
if (isset($_GET['gatsby']) && isset($_GET['dark']) && $_GET['dark'] === 'on') {
?>
<img src="https://cloudimages.broadwayworld.com/promos/gatsbygame.png" alt="Great Gatsby Contest" style="width:100%;height:auto;">
<br><br><iframe width="800" height="400" src="https://www.youtube.com/embed/7nNL8v2lr3E" title="FIRST LOOK: The Great Gatsby Musical arrives on Broadway" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<br><br>
<?php
}
// Fetch contest data
$pdoRead = new PDO($dsnRead, $userRead, $passRead, mysqlPdoOptions([PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]));
$stmt = $pdoRead->prepare("SELECT contesttext, contestterms, contestends, includeaddress, includeentry
FROM contestmain
WHERE id = :id AND contestends > NOW()");
$stmt->execute([':id' => $contestId]);
$contest = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$contest) {
echo 'Sorry, the contest has ended.';
exit;
}
$contestEndsFormatted = date('F j, Y', strtotime($contest['contestends']));
$inputStyle = 'height: 40px;
line-height: 40px;
border-width:1px;border-style:solid;border-color:black; outline: none;
margin-top: 10px;
display: block;
width: 80%;
padding: 0 15px;
font-size: 15px;
font-weight: 500;
max-width: 100%;
font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;';
?>
<FORM action="https://cloud.broadwayworld.com/contestembed.php?submit=<?= $contestId ?>" method="post" enctype="multipart/form-data" target="_blank">
<br>
<b>Contest Ends:</b> <?= $contestEndsFormatted ?> at 12:01AM EST
<br>
<table cellspacing=5 cellpadding=5 border=0>
<tr><td style="padding:4px;">
<b>Name:</b><br>
<input NAME="name" SIZE="40" required style="<?= $inputStyle ?>">
</td><td style="padding:4px;">
<b>Your Email:</b><br>
<input NAME="email" SIZE="40" required style="<?= $inputStyle ?>">
</td></tr>
<tr>
<?php if ((int)$contest['includeaddress'] === 1): ?>
<td style="padding:4px;">
<b>Address:</b><br>
<input NAME="address" SIZE="40" required style="<?= $inputStyle ?>">
</td>
<td style="padding:4px;">
<b>Zip:</b><br>
<input NAME="zipcode" SIZE="40" required style="<?= $inputStyle ?>">
</td>
<?php endif; ?>
<?php if ((int)$contest['includeentry'] === 1): ?>
<td style="padding:4px;">
<b>Entry:</b><br>
<input NAME="Entry" SIZE="40" style="<?= $inputStyle ?>">
</td>
<?php endif; ?></tr>
</table><br>
<input type="submit" Value="Enter Contest" style=" background-color: #a40221;
box-shadow: inset 0 0 0.04px 3.96px rgba(0,0,0,.27);
width: 221px;
height: 51px;
border: none;
outline: none;
color: #fff;
font-size: 21px;
font-weight: 700;">
</form>
</td></tr></table>
<br><br>
<small> <a href="https://cloud.broadwayworld.com/contestembed.php?rules=<?= $contestId ?>" class="link-pad" target="_blank">View Contest Rules</a>
</small>
<?php
}