<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'layoutgrid10')
{
$mailto = 'sellersoft24@mail.ru';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'Website form';
$message = 'Values submitted from web site form:';
$success_url = './uploaddone.php';
$error_url = './uploaderror.php';
$eol = "\n";
$error = '';
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response", "h-captcha-response");
$max_filesize = 51200*1024;
$upload_folder = "upload";
$upload_folder = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])."/".$upload_folder;
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;
try
{
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address (" . $mailfrom . ") is invalid!\n<br>";
throw new Exception($error);
}
$prefix = rand(111111, 999999);
$file_count = 0;
foreach ($_FILES as $key => $value)
{
if (is_array($_FILES[$key]['name']))
{
$count = count($_FILES[$key]['name']);
for ($file = 0; $file < $count; $file++)
{
if ($_FILES[$key]['name'][$file] != "" and file_exists($_FILES[$key]['tmp_name'][$file]) and $_FILES[$key]['size'][$file] > 0)
{
$upload_DstName[$file_count] = $prefix . "_" . str_replace(" ", "_", $_FILES[$key]['name'][$file]);
$upload_SrcName[$file_count] = $_FILES[$key]['name'][$file];
$upload_Size[$file_count] = $_FILES[$key]['size'][$file];
$upload_Temp[$file_count] = $_FILES[$key]['tmp_name'][$file];
$upload_URL[$file_count] = "$upload_folder/$upload_DstName[$file_count]";
$upload_FieldName[$file_count] = $key;
$file_count++;
}
}
}
else
if ($_FILES[$key]['name'] != "" and file_exists($_FILES[$key]['tmp_name']) and $_FILES[$key]['size'] > 0)
{
$upload_DstName[$file_count] = $prefix . "_" . str_replace(" ", "_", $_FILES[$key]['name']);
$upload_SrcName[$file_count] = $_FILES[$key]['name'];
$upload_Size[$file_count] = $_FILES[$key]['size'];
$upload_Temp[$file_count] = $_FILES[$key]['tmp_name'];
$upload_URL[$file_count] = "$upload_folder/$upload_DstName[$file_count]";
$upload_FieldName[$file_count] = $key;
$file_count++;
}
}
for ($i = 0; $i < $file_count; $i++)
{
if ($upload_Size[$i] >= $max_filesize)
{
$error .= "The size of $key (file: $upload_SrcName[$i]) is bigger than the allowed " . $max_filesize/1024 . " Kbytes!\n";
throw new Exception($error);
}
}
$uploadfolder = basename($upload_folder);
for ($i = 0; $i < $file_count; $i++)
{
$uploadFile = $uploadfolder . "/" . $upload_DstName[$i];
if (!is_dir($uploadfolder) || !is_writable($uploadfolder))
{
$error = 'Upload directory is not writable, or does not exist.';
throw new Exception($error);
}
move_uploaded_file($upload_Temp[$i] , $uploadFile);
$name = "$" . $upload_FieldName[$i];
$message = str_replace($name, $upload_URL[$i], $message);
}
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
}
}
if ($file_count > 0)
{
$message .= "\nThe following files have been uploaded:\n";
for ($i = 0; $i < $file_count; $i++)
{
$message .= $upload_SrcName[$i] . ": " . $upload_URL[$i] . "\n";
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=UTF-8'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail($mailto, $subject, $body, $header);
}
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
session_start();
if (!isset($_SESSION['username']))
{
$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];
header('Location: ./login.php');
exit;
}
if (isset($_SESSION['expires_by']))
{
$expires_by = intval($_SESSION['expires_by']);
if (time() < $expires_by)
{
$_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']);
}
else
{
unset($_SESSION['username']);
unset($_SESSION['expires_by']);
unset($_SESSION['expires_timeout']);
$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];
header('Location: ./login.php');
exit;
}
}
$roles = array("Member");
if (!in_array($_SESSION['role'], $roles))
{
header('Location: ./login.php');
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>World Wide</title>
<meta name="generator" content="WYSIWYG Web Builder 17 -
http://www.wysiwygwebbuilder.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/worldwide.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<script src="jquery-1.12.4.min.js"></script>
<script src="jquery.ui.effect.min.js"></script>
<script>
function submitLayoutGrid10()
{
var regexp;
var FileUpload1 = document.getElementById('FileUpload1');
var FileUpload1_file = document.getElementById('FileUpload1-file');
if (!(FileUpload1.disabled ||
FileUpload1.style.display === 'none' ||
FileUpload1.style.visibility === 'hidden'))
{
var ext = FileUpload1_file.value.substr(FileUpload1_file.value.lastIndexOf('.'));
if ((ext.toLowerCase() != ".exe") &&
(ext.toLowerCase() != ".msi") &&
(ext.toLowerCase() != ".rar") &&
(ext.toLowerCase() != ".zip") &&
(ext != ""))
{
alert("The \"FileUpload1\" field contains an unapproved filename.");
return false;
}
}
return true;
}
</script>
<script>
$(document).ready(function()
{
$("a[href*='#logo']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#wb_logo').offset().top }, 600, 'easeOutCirc');
});
$("a[href*='#header']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#wb_header').offset().top }, 600, 'easeOutCirc');
});
$("a[href*='#welcome']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#wb_welcome').offset().top-88 }, 600, 'easeOutCirc');
});
$("#FileUpload1 :file").on('change', function()
{
var input = $(this).parents('.input-group').find(':text');
input.val($(this).val());
});
var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
if (iOS)
{
$('#wb_welcome').css('background-attachment', 'scroll');
}
});
</script>
</head>
<body>
<div id="wb_logo">
<div id="logo">
<div class="row">
<div class="col-1">
<div id="wb_logoIcon" style="display:inline-block;width:47px;height:42px;text-align:center;z-index:0;">
<div id="logoIcon"><i class="fa fa-file-archive-o"></i></div>
</div>
<div id="wb_logoHeading" style="display:inline-block;width:100%;z-index:1;">
<h1 id="logoHeading">FastFiles</h1>
</div>
<hr id="Line1" style="display:block;width: 100%;z-index:2;">
</div>
</div>
</div>
</div>
<div id="wb_header">
<div id="header">
<div class="row">
<div class="col-1">
<div id="wb_headerMenu" style="display:inline-block;width:100%;z-index:3;vertical-align:top;">
<ul id="headerMenu">
<li><a href="./../index.html">Home</a></li>
<li><a href="./../about.html">About</a></li>
<li><a href="./../services.html">Services</a></li>
<li><a href="./../team.html">Team</a></li>
<li><a href="./../contact.html">Contact</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="wb_welcome">
<div id="welcome-divider-bottom">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 355" preserveAspectRatio="none">
<path fill="none" d="M999.45 0H0v165.72l379.95 132.46L999.45 0z"/>
<path class="divider-fill" style="opacity:0.5" d="M379.95 298.18l28.47 9.92L1000 118.75V0h-.55l-619.5 298.18zM492.04 337.25L1000 252.63V118.75L408.42 308.1l83.62 29.15z"/>
<path class="divider-fill" style="opacity:0.5" d="M492.04 337.25L1000 252.63V118.75L408.42 308.1l83.62 29.15z"/>
<path class="divider-fill" d="M530.01 350.49l20.22 4.51H1000V252.63l-507.96 84.62 37.97 13.24z"/>
<path class="divider-fill" style="opacity:0.5" d="M530.01 350.49l20.22 4.51H1000V252.63l-507.96 84.62 37.97 13.24z"/>
<path class="divider-fill" style="opacity:0.5" d="M530.01 350.49l20.22 4.51H1000V252.63l-507.96 84.62 37.97 13.24z"/>
<path class="divider-fill" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"/>
<path class="divider-fill" style="opacity:0.5" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"/>
<path class="divider-fill" style="opacity:0.3" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"/>
<path class="divider-fill" style="opacity:0.5" d="M542.94 355h7.29l-20.22-4.51 12.93 4.51z"/>
<path class="divider-fill" style="opacity:0.3" d="M379.95 298.18L0 165.72v66.59l353.18 78.75 26.77-12.88z"/>
<path class="divider-fill" style="opacity:0.3" d="M353.18 311.06L0 232.31v71.86l288.42 38.06 64.76-31.17z"/>
<path class="divider-fill" style="opacity:0.3" d="M353.18 311.06L0 232.31v71.86l288.42 38.06 64.76-31.17z"/>
<path class="divider-fill" style="opacity:0.5" d="M380.28 317.11l28.14-9.01-28.47-9.92-26.77 12.88 27.1 6.05z"/>
<path class="divider-fill" style="opacity:0.3" d="M380.28 317.11l28.14-9.01-28.47-9.92-26.77 12.88 27.1 6.05z"/>
<path class="divider-fill" style="opacity:0.5" d="M479.79 339.29l12.25-2.04-83.62-29.15-28.14 9.01 99.51 22.18z"/>
<path class="divider-fill" style="opacity:0.5" d="M479.79 339.29l12.25-2.04-83.62-29.15-28.14 9.01 99.51 22.18z"/>
<path class="divider-fill" style="opacity:0.3" d="M479.79 339.29l12.25-2.04-83.62-29.15-28.14 9.01 99.51 22.18z"/>
<path class="divider-fill" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2z"/>
<path class="divider-fill" style="opacity:0.5" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2z"/>
<path class="divider-fill" style="opacity:0.5" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2z"/>
<path class="divider-fill" style="opacity:0.3" d="M530.01 350.49l-37.97-13.24-12.25 2.04 50.22 11.2zM288.42 342.23l9.46 1.25 82.4-26.37-27.1-6.05-64.76 31.17z"/>
<path class="divider-fill" style="opacity:0.5" d="M288.42 342.23l9.46 1.25 82.4-26.37-27.1-6.05-64.76 31.17z"/>
<path class="divider-fill" style="opacity:0.3" d="M288.42 342.23l9.46 1.25 82.4-26.37-27.1-6.05-64.76 31.17z"/>
<path class="divider-fill" style="opacity:0.5" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"/>
<path class="divider-fill" style="opacity:0.3" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"/>
<path class="divider-fill" style="opacity:0.5" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"/>
<path class="divider-fill" style="opacity:0.3" d="M380.28 317.11l-82.4 26.37 87.3 11.52h.34l94.27-15.71-99.51-22.18z"/>
<path class="divider-fill" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"/>
<path class="divider-fill" style="opacity:0.5" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"/>
<path class="divider-fill" style="opacity:0.3" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"/>
<path class="divider-fill" style="opacity:0.5" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"/>
<path class="divider-fill" style="opacity:0.3" d="M479.79 339.29L385.52 355h157.42l-12.93-4.51-50.22-11.2z"/>
<path class="divider-fill" d="M288.42 342.23L0 304.17V355h385.18l-87.3-11.52-9.46-1.25z"/>
</svg></div>
<div id="welcome">
<div class="col-1">
<div id="wb_Heading1" style="display:inline-block;width:100%;z-index:4;">
<h1 id="Heading1">Загрузка файла</h1>
</div>
<div id="wb_Heading2" style="display:inline-block;width:100%;z-index:5;">
<h1 id="Heading2">Пожалуйста, загружайте файлы до 50 мб (это макс. размер файлов на тарифе Free) и с расширениями .rar, .exe, .msi, .jpg, .png, .ico, полный список расширений вы можете найти в пункте "Расширения" на главной странице.</h1>
</div>
</div>
</div>
</div>
<div id="upStickyLayer" style="position:fixed;text-align:left;left:auto;right:25px;top:auto;bottom:25px;width:50px;height:50px;z-index:33;">
<div id="wb_upIcon" style="position:absolute;left:9px;top:8px;width:24px;height:24px;text-align:center;z-index:6;">
<a href="./../index.html#home"><div id="upIcon"><i class="fa fa-angle-up"></i></div></a></div>
</div>
<div id="wb_LayoutGrid10">
<form name="LayoutGrid10" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" id="LayoutGrid10" onsubmit="return submitLayoutGrid10()">
<input type="hidden" name="formid" value="layoutgrid10">
<div class="row">
<div class="col-1">
<div id="wb_Heading10" style="display:inline-block;width:100%;z-index:7;">
<h2 id="Heading10">Загрузка файла на сервер.</h2>
</div>
<div id="wb_Text12">
<span style="color:#4F4F4F;">Доступные расширения: .rar, .zip, .exe, .msi</span>
</div>
<div id="wb_FontAwesomeIcon1" style="display:inline-block;width:64px;height:64px;text-align:center;z-index:9;">
<div id="FontAwesomeIcon1"><i class="fa fa-envelope-o"></i></div>
</div>
</div>
<div class="col-2">
<div class="col-2-padding">
<input type="text" id="Editbox4" style="display:block;width: 100%;height:42px;z-index:10;" name="name" value="" spellcheck="false" placeholder="Ваше имя">
<input type="text" id="Editbox5" style="display:block;width: 100%;height:42px;z-index:11;" name="email" value="" spellcheck="false" placeholder="Ваш email">
<div id="FileUpload1" class="input-group" style="display:table;width: 100%;height:34px;z-index:12;">
<input class="form-control" type="text" readonly="">
<label class="input-group-btn">
<input type="file" accept=".exe,.msi,.rar,.zip" name="FileUpload1" id="FileUpload1-file" style="display:none;"><span class="btn">Выбрать...</span>
</label>
</div>
<input type="submit" id="Button1" name="" value="Загрузить файл" style="display:inline-block;width:154px;height:39px;z-index:13;">
</div>
</div>
</div>
</form>
</div>
<div id="wb_contact">
<div id="contact">
<div class="row">
<div class="col-1">
<div class="col-1-padding">
<div id="wb_contactHeading1" style="display:inline-block;width:100%;z-index:14;">
<h3 id="contactHeading1">ABOUT US</h3>
</div>
<div id="wb_contactText1">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam sit nonummy nibh euismod tincidunt ut laoreet dolore magna aliquarm erat sit volutpat. Nostrud exerci tation ullamcorper suscipit lobortis nisl aliquip commodo consequat.</p>
<p> </p>
<p>Duis autem vel eum iriure dolor vulputate velit esse molestie at dolore.</p>
</div>
</div>
</div>
<div class="col-2">
<div class="col-2-padding">
<div id="wb_contactHeading2" style="display:inline-block;width:100%;z-index:16;">
<h3 id="contactHeading2">INFORMATION</h3>
</div>
<div id="wb_contactMenu" style="display:inline-block;width:100%;z-index:17;">
<ul id="contactMenu" role="menubar" class="nav">
<li role="menuitem" class="nav-item firstmain"><a class="nav-link" href="" target="_self">Lorem Ipsum</a>
</li>
<li role="menuitem" class="nav-item"><a class="nav-link" href="" target="_self">Dolor Sit Amet</a>
</li>
<li role="menuitem" class="nav-item"><a class="nav-link" href="" target="_self">Consectetur Adipisicing</a>
</li>
<li role="menuitem" class="nav-item"><a class="nav-link" href="" target="_self">Sed Do Eiusmod</a>
</li>
<li role="menuitem" class="nav-item"><a class="nav-link" href="#" target="_self">Contact Us</a>
</li>
<li role="menuitem" class="nav-item"><a class="nav-link" href="#" target="_self">Customer Service</a>
</li>
<li role="menuitem" class="nav-item"><a class="nav-link" href="#" target="_self">Careers</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-3">
<div class="col-3-padding">
<div id="wb_contactHeading3" style="display:inline-block;width:100%;z-index:18;">
<h3 id="contactHeading3">CONTACT</h3>
</div>
<div id="wb_contactText2">
<p>#28, 3nd floor, WYSIWYG Plaza<br/>Web City, Builder, WB 1969</p>
<p>Phone: 100 121 34567</p>
<p>Fax: 100 121 34568</p>
<p>Email:
info@wysiwygmail.com</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="wb_footer">
<div id="footer">
<div class="row">
<div class="col-1">
<div class="col-1-padding">
<div id="wb_footerIcon1" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:20;">
<a href="./../index.html"><div id="footerIcon1"><i class="fa fa-rss"></i></div></a>
</div>
<div id="wb_footerIcon2" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:21;">
<a href="./../index.html"><div id="footerIcon2"><i class="fa fa-facebook"></i></div></a>
</div>
<div id="wb_footerIcon3" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:22;">
<a href="./../index.html"><div id="footerIcon3"><i class="fa fa-twitter"></i></div></a>
</div>
<div id="wb_footerIcon4" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:23;">
<a href="./../index.html"><div id="footerIcon4"><i class="fa fa-instagram"></i></div></a>
</div>
<div id="wb_footerIcon5" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:24;">
<a href="./../index.html"><div id="footerIcon5"><i class="fa fa-youtube"></i></div></a>
</div>
<div id="wb_footerIcon6" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:25;">
<a href="./../index.html"><div id="footerIcon6"><i class="fa fa-vimeo"></i></div></a>
</div>
<div id="wb_footerIcon7" style="display:inline-block;width:20px;height:20px;text-align:center;z-index:26;">
<a href="./../index.html"><div id="footerIcon7"><i class="fa fa-linkedin"></i></div></a>
</div>
</div>
</div>
<div class="col-2">
<div class="col-2-padding">
<label for="footerEmail" id="footerLabel" style="display:inline-block;width:136px;line-height:19px;z-index:27;">NEWSLETTER</label>
<input type="text" id="footerEmail" style="display:inline-block;width:229px;height:34px;z-index:28;" name="email" value="" spellcheck="false" placeholder="yourname@email.com">
<input type="submit" id="footerButton" name="" value="SUBSCRIBE" style="display:inline-block;width:97px;height:34px;z-index:29;">
</div>
</div>
</div>
</div>
</div>
<hr id="Line3" style="position:absolute;left:833px;top:606px;width:250px;z-index:39;">
</body>
</html>