Skip to content

Instantly share code, notes, and snippets.

@jonathan-fulton
Created June 15, 2017 19:00
Show Gist options
  • Save jonathan-fulton/9adbebebcaaaabf9098b9705e044725b to your computer and use it in GitHub Desktop.
Save jonathan-fulton/9adbebebcaaaabf9098b9705e044725b to your computer and use it in GitHub Desktop.
Bad PHP Code from A Long Time Ago
<?php
if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }
require $_SERVER["DOCUMENT_ROOT"] . "/common.php";
require $_SERVER["DOCUMENT_ROOT"] . "/classes/libs/google/gcookie.class.php";
if ($language == 'en') header ("location: $sitesecureurl/freeclips/");
$ga = new GA_Parse($_COOKIE);
if ($logged) header ("location: $siteurl/member/dashboard/");
if (isset($_GET['error'])) $e = $db->escape_data($_GET['error']);
if (isset($_GET['code'])) $msg = "<div class=\"success_msg\"><div><p>Your activation code <b>C3DW75</b> has been applied. Please complete your account setup below.</p></div></div>";
$today = date("Y-m-d");
$sql = "UPDATE vblox_user_landing SET trial_page = trial_page + 1 WHERE date_landing = '$today'";
$db->Query($sql);
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['trialsignup'])) {
foreach ($_POST as $key => $value) $dataList[$key] = $db->escape_data($value);
$sentParameters = array(
array('fname', 2, 255, 'all', 'Invalid First Name'),
array('lname', 2, 255, 'all', 'Invalid Last Name'),
array('email', 2, 255, 'email', 'Invalid Email'),
array('username', 4, 255, 'all', 'Invalid Username'),
array('password', 6, 255, 'all', 'Invalid Password'),
);
$errorMessage = $db->validateFields($sentParameters, $dataList);
if (vBloxMember::checkMemberExists($dataList[email])) {
$errorMessage["accountexists"] = "Yes";
$msg = "<div class=\"red_error\"><div><p>Email is already associated with an existing account.</p></div></div>";
}
if (vBloxMember::checkUsernameExists($dataList[username])) {
$errorMessage["accountexists"] = "Yes";
$msg = "<div class=\"red_error\"><div><p>Username is already taken. Please choose a different one.</p></div></div>";
}
if (count($errorMessage) <= 0) {
$unique = $db->GenerateUniqueURL("15");
$campaign_code = $ga->campaign_name;
$result = vBloxMember::createTempTrialMember($dataList[plan_id], $dataList[fname], $dataList[lname], $dataList[email], $dataList[username], $dataList[password], $campaign_code, $unique, $dataList[emailexclusive]);
if ($result) header ("location: $sitesecureurl/ifreeclips/finalize.php?i=$unique");
else $msg = "<div class=\"red_error\"><div><p>An internal error has occured (Code FTS113). Please contact <a href=\"mailto:[email protected]\">[email protected]</a>.</p></div></div>";
} else $msg = "<div class=\"red_error\"><div><p>All field are required.</p></div></div>";
}
$uid = $db->escape_data($_GET['uid']);
if (isset($uid)) {
$sql = "SELECT fname, lname, email, username from temp_card_members WHERE unique_id = '$uid'";
$db->Query($sql); if ($db->RowCount() != 0) $urow = $db->Row();
}
$_SESSION['formToken'] = sha1($formsalt.microtime());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Free Stock Footage Downloads - Video Blocks</title>
<meta name="keywords" content="free stock footage, download free stock video, free stock video, free looping backgrounds, free production music, free sound effects, free footage downloads">
<meta name="description" content="Get your 7 days of completely free downloads of stock video, looping backgrounds, production music, sound effects and more.">
<meta name="robots" content="noindex,nofollow">
<?php include_once $_SERVER["DOCUMENT_ROOT"] . "/inc/header.php"; ?>
</head>
<body>
<div id="fb-root"></div>
<?php //include_once "../inc/after_body.php"; ?>
<div id="wrapper">
<div class="w1">
<div class="w2">
<div id="header">
<div class="top-block">
<?php //include_once "../inc/topwrap.php"; ?>
</div>
<div class="holder">
<h1 class="logo">Free Stock Footage - 100,000+ clips</h1>
<div class="statistic">
<?php //include_once "../inc/clipstatbox.php"; ?>
</div>
<div class="frame">
<div style="text-align: right; margin-bottom: 10px;"><a target="_blank" href="https://www.mcafeesecure.com/RatingVerify?ref=www.videoblocks.com"><img width="65" height="37" border="0" src="//images.scanalert.com/meter/www.videoblocks.com/63.gif" alt="McAfee SECURE sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams" oncontextmenu="alert('Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.'); return false;"></a></div>
<span class="phone">24 Hour Support: <span><? if ($language=="es") echo "<a class='notranslate' href='mailto:[email protected]'>[email protected]</a>"; ?> | <?php echo $global_phone; ?></span></span>
<?php //include_once "../inc/quickjump.php"; ?>
</div>
</div>
<div class="nav-holder">
<?php //include_once "../inc/nav.php"; ?>
<ul id="nav">
<li>&nbsp;</li>
</ul>
<?php //include_once "../inc/search.php"; ?>
</div>
</div>
<div id="container">
<?php if (isset($msg)) { echo $msg; } ?>
<div class="mboxDefault">
<div class="teaser-block">
<h2>7 DAYS OF <span>FREE</span> DOWNLOADS</h2>
<h3>DOWNLOAD FROM <span>100,000+</span> CLIPS OF VIDEO, MOTION BACKGROUNDS, SOUND EFFECTS, PRODUCTION MUSIC, and MORE!</h3>
</div>
</div>
<script language="javascript1.2">
mboxCreate('VBlox100212MainGraphic');
</script>
</div>
<div class="immediately-start">
<div class="holder">
<div class="title">
<h2>START DOWNLOADING IMMEDIATELY</h2>
</div>
<div class="frame">
<div class="create-account">
<div class="title"><h3>Create an Account and Start Downloading</h3></div>
<div class="holder">
<form class="form-create-account SL_norewrite" method="post">
<fieldset>
<div class="row">
<div class="text-frame">
<?php if ($_POST['fname'] != '') { ?>
<input type="text" value="<?php echo $_POST['fname']; ?>" name="fname" class="text required translate" />
<? } else if ($urow->fname != '') { ?>
<input type="text" value="<?php echo $urow->fname; ?>" name="fname" class="text required translate" />
<? } else { ?>
<input type="text" value="First Name" name="fname" class="text defaultInvalid required translate" />
<? } ?>
<span class="error translate"><span>This field is required.</span></span>
</div>
</div>
<div class="row">
<div class="text-frame">
<?php if ($_POST['lname'] != '') { ?>
<input type="text" value="<?php echo $_POST['lname']; ?>" name="lname" class="text required translate" />
<? } else if ($urow->lname != '') { ?>
<input type="text" value="<?php echo $urow->lname; ?>" name="lname" class="text required translate" />
<? } else { ?>
<input type="text" value="Last Name" name="lname" class="text defaultInvalid required translate" />
<? } ?>
<span class="error translate"><span>This field is required.</span></span>
</div>
</div>
<div class="row">
<div class="text-frame">
<?php if ($_POST['email'] != '') { ?>
<input type="text" value="<?php echo $_POST['email']; ?>" name="email" class="text email required" />
<? } else if ($urow->email != '') { ?>
<input type="text" value="<?php echo $urow->email; ?>" name="email" class="text email required translate" />
<? } else { ?>
<input type="text" value="Email Address" name="email" class="text email required translate" />
<? } ?>
<span class="error translate"><span>Please enter a valid email address.</span></span>
</div>
</div>
<div class="row">
<p>We respect your privacy and will NOT share your info</p>
</div>
<div class="row">
<div class="text-frame">
<? if ($urow->username != '') { ?>
<input type="text" value="<?php echo $urow->username; ?>" name="username" class="text required" minlength="6" />
<? } else { ?>
<input type="text" value="Choose a Username" name="username" class="text defaultInvalid required translate noSpace" minlength="6" />
<? } ?>
<span class="error translate"><span>Username already exist.</span></span>
</div>
</div>
<div class="row">
<div class="text-frame">
<input type="password" id="password" value="Choose your Password" name="password" class="text defaultInvalid password translate noSpace" minlength="6" />
</div>
</div>
<div class="row">
<div class="text-frame">
<input type="password" value="Confirm your Password" name="password_again" class="text password_again password translate noSpace" minlength="6" equalto="#password" />
<span class="error translate"><span>Password did not match.</span></span>
</div>
</div>
<div class="row">
<input type="checkbox" id="agree" name="agree-box" class="checkbox required" />
<label for="agree">I agree to the <a class="ibox" href="http://www.videoblocks.com/agreement.html">Terms and Conditions</a></label>
</div>
<?php if ($language == 'de-DE') { ?>
<div class="row">
<input type="checkbox" id="emailexclusive" name="emailexclusive" value="yes" class="checkbox" />
<label for="emailexclusive">Email me exclusive deals, and the latest offers.</label>
</div>
<? } ?>
<div class="submit-row">
<input type="submit" value="START FREE DOWNLOADING" class="submit translate" />
<img src="/images/img-verisign-secured02.jpg" height="28" width="57" alt="Verisign Secured" class="secured" />
</div>
</fieldset>
<input type="hidden" name="plan_id" value="<?php echo vBloxMember::getPlanIds("freetrial"); ?>" />
<input type="hidden" name="trialsignup" value="yes" />
<input type="hidden" name="token" value="<?php echo $_SESSION['formToken']; ?>" />
</form>
</div>
</div>
<ul class="benefits">
<li>
<h2>DOWNLOADS PER DAY</h2>
<h3>20 CLIPS</h3>
</li>
<li>
<h2>ACCESS MORE THAN</h2>
<h3>100,000</h3>
<ul>
<li>VIDEO CLIPS</li>
<li>SOUND EFFECTS</li>
<li>LOOPING BACKGROUNDS</li>
<li>MUSIC TRACKS</li>
<li>AE TEMPLATES</li>
</ul>
</li>
<li>
<h2>NO OBLIGATION</h2>
<h3>100% FREE</h3>
</li>
</ul>
</div>
</div>
</div>
<ul class="secured-section">
<li><img src="/images/ico-barge08.jpg" height="101" width="157" alt="Verisign Secured" /></li>
<li><img src="/images/ico-barge09.jpg" height="101" width="220" alt="Mcafee Secured" /></li>
<li><img src="/images/ico-barge10.jpg" height="101" width="216" alt="Truste Certified" /></li>
</ul>
<div id="footer">
<?php //include_once "../inc/footer.php"; ?>
<div class="bottom-block">
<strong class="logo"><a href="http://www.videoblocks.com/">VideoBlocks</a></strong>
<span class="policy"><a href="//privacy-policy.truste.com/click-to-verify/www.videoblocks.com" title="Privacy Policy by TRUSTe" target="_blank">Privacy Policy</a> &#124; <a href="/agreement.html" target="_blank">Terms Of Use</a> &#124; <a href="/pdf/VideoBlocksRoyaltyFreeLicenseAgreement.pdf" target="_blank">Royalty Free License Agreement</a></span>
<p>Copyright &copy; <?php echo date("Y"); ?> <a href="http://www.videoblocks.com/">Videoblocks.com</a>. All Rights Reserved.</p>
</div>
</div>
</div>
</div>
</div>
<div class="loading-overlay"></div>
<img src="/images/loader.gif" alt="Processing" class="loader" width="128" height="15" />
<!-- Start Quantcast Tag -->
<script type="text/javascript">
_qoptions={qacct:"p-0a8D7wSAGUJw6",labels:"_fp.event.Free Clips"};
</script>
<script type="text/javascript" src="//secure.quantserve.com/quant.js"></script>
<noscript>
<img src="//secure.quantserve.com/pixel/p-0a8D7wSAGUJw6.gif?labels=_fp.event.Free+Clips" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
</noscript>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment