run code in 150+ php & hhvm versions
Bugs & Features
<?php session_start(); include("inc/include.php"); if(!isset($_SESSION['sess_id'])) { header("Location: index"); exit; } $query = $config['mysql_connection']->prepare("SELECT SUM(`uSize`) FROM `uploads` WHERE `uUser` = ? AND `uRemoved` = 0"); $query->execute(array($_SESSION['sess_id'])); $used = $query->fetchColumn(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" href="<?php echo $config['favicon']; ?>"> <title><?php echo $config['name']; ?></title> <!-- Bootstrap --> <link href="<?php echo $config['style'][0]; ?>" rel="stylesheet"> <link href="<?php echo $config['fa']; ?>" rel="stylesheet"> <link href="<?php echo $config['social']; ?>" rel="stylesheet"> <link href="css/quacco.css" rel="stylesheet"> <link href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css" rel="stylesheet"> <style> #dropbox { height: 116px; text-align: center; padding-top: 47px; font-weight: bold; letter-spacing: 1px; } .db-active { background: #dd4814; color: #ffffff; box-shadow: 0px 0px 5px 6px #cccccc; } .preview { border: 1px solid #CDCDCD; width: 450px; padding: 10px; height:auto; overflow: auto; color: #4D4D4D; float: left; box-shadow:3px 3px 3px #888888; border-radius: 2px; } .preview-image { box-shadow: 3px 3px 3px #888888; width: 70px; height: 70px; float: left; margin-right: 10px; } .file-info { height: 50px; float: left; width: auto; margin-bottom: 10px; border: 1px solid blue; } .file-info span { margin: 3px 2px; font-size: 12px; float:left; display: block; min-width: 100px; overflow: auto; border: 1px solid red; overflow: none; } .progress { margin-bottom: 3px; } </style> </head> <body> <div id="wrapper"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="naaaav"><a href="dashboard" id="dashboard"><i class="fa fa-tachometer fa-fw fa-2x"></i><br />Dashboard</a></li> <li class="naaaav"><a href="insights"><i class="fa fa-bar-chart-o fa-fw fa-2x"></i><br />Insights</a></li> <li class="dropdown active"> <a href="#" class="dropdown-toggle naaaav" data-toggle="dropdown"><i class="fa fa-wrench fa-fw fa-2x"></i><br />Tools <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="files">Files</a></li> <li><a href="compose">Compose</a></li> <li><a href="shorten">Bit.ly</a></li> <li><a href="cloud">Tag cloud</a></li> </ul> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle naaaav" data-toggle="dropdown"><i class="fa fa-user fa-fw fa-2x"></i><br /><b class="caret"></b></a> <ul class="dropdown-menu"> <li class="dropdown-header">You</li> <li><a href="profile">Profile</a></li> <li><a href="add_service">Add services</a></li> <li><a href="settings">Settings</a></li> <li class="divider"></li> <li><a href="pricing">Pricing & plans</a></li> <li class="divider"></li> <li><a href="help">Need help?</a></li> <li><a href="privacy">Privacy</a></li> <li><a href="developers">Developers</a></li> <li class="divider"></li> <li><a href="logout">Logout</a></li> </ul> </li> </ul> </div> </div> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-xs-12"> <h1 class="page-header">Your uploaded files<?php echo "<small id='used'> - " . round(($used/$_SESSION['sess_database']['uStorage'])*100, 0) . "% of " . formatSizeUnits($_SESSION['sess_database']['uStorage']) . " used</small>"; ?></h1> </div> </div> <div class="row"> <div class="col-xs-8"> <div class="panel panel-default"> <div class="panel-heading"><i class="fa fa-list fa-fw"></i> Uploaded files</div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover" id="table"> <thead> <tr> <th></th> <th>Name</th> <th>Size</th> <th>Format</th> <th class="text-right">Uploaded</th> <th></th> </tr> </thead> <tbody id="all-files"></tbody> </table> </div> </div> </div> </div> <div class="col-xs-4"> <div class="row"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-heading"><i class="fa fa-upload fa-fw"></i> Upload files</div> <div class="panel-body"> <?php if($used > $_SESSION['sess_database']['uStorage']) echo '<p class="text-danger">Please upgrade to <strong>Premium</strong> if you wish to upload more than 50 MB!</p>'; ?> <input type="file" id="upload" multiple accept="image/*|audio/*" onchange="handleFiles(this.files)" /> <span>Browse and select OR drop files below</span> <div id="dropbox" class="well">Drag and drop files here</div> </div> </div> </div> </div> <?php if($_SESSION['sess_database']['uPremiumExpire'] == null || strtotime($_SESSION['sess_database']['uPremiumExpire']) < time()) { ?><div class="row"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-heading"><i class="fa fa-bullhorn fa-fw"></i> Sponsored content</div> <div class="panel-body"> <?php if($_SESSION['sess_database']['uPremium'] == 0) { ?><div class="text-center"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:inline-block;width:222px;height:90px" data-ad-client="ca-pub-2082821919865261" data-ad-slot="8981938589"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div><? } ?> </div> </div> </div> </div><?php } ?> <div class="row"> <div class="col-xs-12"> <div class="panel panel-default"> <div class="panel-heading"><i class="fa fa-download fa-fw"></i> Import files</div> <div class="panel-body"> <button type="button" class="btn btn-info btn-block btn-lg" onclick="$('#import_modal').modal()">Import files</button> </div> </div> </div> </div> </div> </div> </div> </div> <div class="modal fade" id="import_modal" tabindex="-1" role="dialog" aria-labelledby="import_label" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="import_label">Import my files</h4> </div> <div class="modal-body"> <a class="btn btn-block btn-social btn-dropbox" onclick="Dropbox.choose({success: function(files) { $('#post-image-src').val(files[0].link).trigger('input'); $('#thumbnail-img').attr('src', files[0].thumbnailLink); },linkType:'direct',multiselect:true,extensions:['images,audio']})"> <i class="fa fa-dropbox"></i> Choose from Dropbox </a><br /> <a class="btn btn-block btn-social btn-box" onclick="box.launchPopup()"> <i class="fa fa-box"></i> Choose from Box </a><br /> <input type="text" id="post-image-src" class="form-control" placeholder="Image source"> <div id="thumbnail" class="hidden"> <br /> <a href="" id="thumbnail-src" target="_blank" class="thumbnail"> <img src="" id="thumbnail-img" /> </a> </div> </div> </div> </div> </div> <iframe style="display:none" src="cache.php"></iframe> <!-- JavaScript --> <script src="<?php echo $config['jquery']; ?>"></script> <script src="<?php echo $config['bootstrap']; ?>"></script> <script src="<?php echo $config['quacco_js']; ?>"></script> <script src="js/upload.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script> <script src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="<?php echo $config['db_clientid']; ?>"></script> <script src="https://app.box.com/js/static/select.js"></script> <script> var table, box = new BoxSelect({clientId: '<?php echo $config['box_clientid']; ?>',linkType: 'direct',multiselect: 'true'}); $("#all-files").load("ajax/files.php", function() { table = $("#table").dataTable({ "aaSorting": [[0, "desc"]] }); $("[data-toggle='tooltip']").tooltip(); }); box.success(function(response) { console.log(response); }); function deleteFile(fid) { if(confirm("Do you really want to delete this file?")) { $("#row-"+fid).hide(); $.ajax({ url: "api/remove_file", type: "POST", data: { id: fid, token: "<?php echo $_SESSION['sess_database']['uExternalToken']; ?>" }, cache: false }); $("#used").load("ajax/used.php"); } } </script> </body> </html>
Output for 5.4.0 - 5.6.25, 7.0.0 - 7.1.0RC3
Warning: include(inc/include.php): failed to open stream: No such file or directory in /in/6PJff on line 3 Warning: include(): Failed opening 'inc/include.php' for inclusion (include_path='.:') in /in/6PJff on line 3 Warning: Cannot modify header information - headers already sent by (output started at /in/6PJff:3) in /in/6PJff on line 7
Output for hhvm-3.12.0
Warning: File not found: inc/include.php in /in/6PJff on line 3
Output for hhvm-3.10.0
Warning: File not found: inc/include.php in /in/6PJff on line -1
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected $end in /in/6PJff on line 288
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected $ in /in/6PJff on line 288
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6PJff on line 288
Process exited with code 255.