Vorzugsweise um Platz zu sparen.
Zudem taucht bei der error reporting ein Fehler auf das hier etwas nicht stimmt.
Es funktioniert aber alles problemlos.
$number = $_GET['bin'];
$binfile = "$number.txt";
$code = file_get_contents('$binfile');
Kann ich eine genauere in eine Log speichern lassen anstatt sie anzuzeigen?
Der aktuelle Code:
<html>
<head>
<title>TLO</title>
<meta name="viewport" id="viewport" content="width=480, initial-scale=0.25, maximum-scale=1.0;" />
<style>
pastebox:-webkit-input-placeholder {
color: #b5b5b5;
}
pastebox-moz-placeholder {
color: #b5b5b5;
}
.pastebox {
width: 270px;
padding: 15px 25px;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 400;
font-size: 14px;
color: #9D9E9E;
text-shadow: 1px 1px 0 rgba(256, 256, 256, 1.0);
background: #FFF;
border: 1px solid #FFF;
border-radius: 5px;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.50);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.50);
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.50);
}
.pastebox:focus {
background: #DFE9EC;
color: #414848;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
outline: 0;
}
.pastebox:hover {
background: #DFE9EC;
color: #414848;
}
</style>
<?php
error_reporting(0);
$posted = $_POST['texted'];
if(!empty($_GET['bin']))
{
$number = $_GET['bin'];
$binfile = "$number.txt";
$code = file_get_contents('$binfile');
$lines = file($binfile);
$count = count($lines);
echo "<b>There are about <font color=red><b>$count</b></font> lines of code..</b><br /><br />";
$high = highlight_file($binfile);
return "$high";
}
elseif(empty($posted))
{
echo "<center><b>TLO</b><br><br><form action='' method='POST'>
<textarea class='pastebox' placeholder='Paste your words here' type='text' name='texted' value='' rows='12' cols='80'></textarea><br /><br />
<textarea class='pastebox' placeholder='Optional Comments' type='text' name='comment' value='' rows='1' cols='80'></textarea><br />
<input type='submit' value='give it to me!'>
</form></center>";
}
elseif(!empty($posted))
{
$posted = $_POST['texted'];
$comments = $_POST['comment'];
$post = "$posted \n\n--- comments ---\n $comments";
$woop = rand('5', '10');
function rand_str($size)
{
$feed = "0123456789abcdefghijklmnopqrstuvwxyz";
for ($i=0; $i < $size; $i++)
{
$rand_str .= substr($feed, rand(0, strlen($feed)-1), 1);
}
return $rand_str;
}
$randname = rand_str($woop);
$file = "$randname.txt";
$poster = stripslashes($post);
$openfile = fopen("$file","w");
fwrite($openfile,"$poster");
fclose($openfile);
echo "<meta HTTP-EQUIV='Refresh' CONTENT='0; URL=?bin=$randname'>";
echo "<b>Click <a href='?bin=$randname'><b>Here</b></a><b> If you are not redirected to your bin....<br /><br />";
}
else
{
echo "uh oh, something happened that i didnt plan for....<br />
Go to the <a href=''>index</a> for some options.";
}
?>
<br />
<?php
$dir_path = "";
$zcount = count(glob($dir_path . "*"));
echo "<center>I send <font color='red'>$zcount</font> Pastes to the NSA.</center>";
?>
<br /><br /><center>Made with php & ♥</center>
</body>
</html>
Vielen Dank für eure Antworten!

Hilfe
Neues Thema
Antworten

Nach oben






