File: /var/www/vhosts/onlinedev.com/httpdocs/snakes/nletter.php
<?php
if ( isset($_POST['user']) && isset($_POST['pass']) && $_POST['user'] == "onlinedev" && $_POST['pass'] == 'newsLetter321' ) {
$link = mysql_connect("213.11.100.112", "dicky", "pitonul");
$db = mysql_select_db("onlinedev", $link);
if (isset($_REQUEST["floor"])) $floor = $_REQUEST["floor"];
if (isset($_REQUEST["ceil"])) $ceil = $_REQUEST["ceil"];
if ( !empty($ceil) && !empty($floor) )
$result = mysql_query("SELECT * FROM mail_t WHERE 1 LIMIT ".$floor.", ".$ceil);
else
$result = mysql_query("SELECT * FROM mail_t WHERE 1 ");
$numRows = mysql_num_rows($result);
if ($numRows) {
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"mails.txt\"");
header("Content-Transfer-Encoding: text");
header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Pragma: no-cache");
}
for ($i = $numRows; $i >= 1 ; $i--) {
//echo "numrows= ".$i;
$row = mysql_fetch_assoc($result);
echo $row['address']."\r\n";
}
if (isset($result)) mysql_free_result($result);
mysql_close($link);
} elseif ( !isset($_POST['user']) || !isset($_POST['pass'])) {
?>
<div style="text-align: center">
<h5 style="margin: 10px; text-align: center">Authentification:</h5>
<div style="width: 186px; height: 90px; margin: auto">
<form action="<?=basename($_SERVER['PHP_SELF'])?>" method="post" name="login">
<div style="width: 220px; line-hight: 16pt; clear: both">
<div style="text-align: left; font-family: Verdana,Sans; font-size: 8pt; line-height: 16pt;vertical-align: bottom; float: left; width: 120px;">Nom: </div>
<div style="float: left; width: 100px;"><input name="user" type="text" class="f_input" style=" width: 100%" /></div>
</div>
<div style="width: 220px; clear: both; line-height: 16pt;">
<div style="text-align: left; font-family: Verdana,Sans; font-size: 8pt; line-height: 16pt;vertical-align: bottom; float: left; width: 120px;">Mot de passe: </div>
<div style="float: left; width: 100px;"><input name="pass" type="password" class="f_input" style="width: 100%" onfocus='document.login.u_pass.value = ""' /></div>
</div>
<div style="width: 220px; clear:both; text-align:center">
<input name="intra" type="submit" value="Entrer" class="f_submit" style="width: 100%" />
</div>
</form>
</div>
<script language="javascript"> <!--
document.login.u_name.focus();
//--></script>
</div>
<?
} else {
echo "<h5 style='color:darkred; text-align: center; margin: auto'>Wrong username or password.</h5>";
}
?>