php/html help

TrueJewix

Member
Aug 9, 2012
332
21
<?php

if($_SESSION['user']['rank'] >= 1) {
$key = false;
$error = false;
$q = mysql_query("SELECT * FROM users WHERE id = '{$_SESSION['user']['id']}' AND account_locked = '1' LIMIT 1")or die(mysql_error());
if(mysql_num_rows($q) == 1) {
echo "This account has been locked. Please contact Joe immediately.";
exit;
}

if(isset($_POST['pin'])) {
$q = mysql_query("SELECT id FROM users WHERE id = '{$_SESSION['user']['id']}' AND housekeeping_pin = '" . md5($_POST['pin']) . "' AND account_locked = '0' LIMIT 1")or die(mysql_error());
if(mysql_num_rows($q) != 1) {
if(!isset($_SESSION['client']['attempts']))
$_SESSION['client']['attempts'] = 0;
$_SESSION['client']['attempts']++;
if($_SESSION['client']['attempts'] >= 999999999)
mysql_query("UPDATE users SET account_locked = '1' WHERE id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());
$error = true;
}else{
$key = true;
}
}

if(!$key) {
?>


<html>
<head>
<title>Nebbo Hotel</title>

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<link href="animate.css" rel="stylesheet" type="text/css" />
<script src='
<script src=" "></script>

</script>
<script src=" "></script>

</head>
<body>


<!--<div class="redalert">
<div class="redmessage"><b>Keep calm and play on</b>, people are trying to <b>hack</b> us and <b>DDoS</b> us right now. It won't affect anything. Promise Enjoy:)</b></div>
</div>-->
<div class="logo"><div class="animated bounceInDown"><img src=" "></div></div>

<div class="totalresolvers">
<form action="#" class="cleanForm" method="POST" autocomplete="off">
<div class="column">
<input type="password" name="password" placeholder="" maxlength="12" autocomplete="off" />

<input type="submit" value="submit"/>

</form>
</div>


<div class="thold"><div class="tholdtext">Please enter '1234' above to verify you're a human being.</div></div>
</div>





<div class="line">
</div>

<!--<script>
$("#nav").hover(function(){
$('.redalert').fadeOut(5);
});
</script>

<script>
$("#nav").mouseleave(function(){
$('.redalert').fadeIn(500);
});
</script>
-->
</body>
</html>


It keeps giving me 'Parse error: syntax error, unexpected end of file in /Applications/XAMPP/xamppfiles/htdocs/test/test.php on line 85' error.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,142
2,468
This was some of the worst coding ever. As I saw "totalresolves", enjoy scriptkid. Next time, when you open a if statement (!$key), also close it at the end of the page. Look up the errors PHP gives you.
PHP:
<?php

if ($_SESSION['user']['rank'] >= 1)
{
    $key   = false;
    $error = false;
    $query = mysql_query("SELECT * FROM users WHERE id = '{$_SESSION['user']['id']}' AND account_locked = '1' LIMIT 1") or die(mysql_error());

    if (mysql_num_rows($query) == 1)
    {
        echo "This account has been locked. Please contact Joe immediately.";
        exit;
    }
}

if (isset($_POST['pin']))
{
    $q = mysql_query("SELECT id FROM users WHERE id = '{$_SESSION['user']['id']}' AND housekeeping_pin = '" . md5($_POST['pin']) . "' AND account_locked = '0' LIMIT 1") or die(mysql_error());

    if (mysql_num_rows($q) != 1)
    {
        if (!isset($_SESSION['client']['attempts']))
        {
            $_SESSION['client']['attempts'] = 0;
        }
       
        $_SESSION['client']['attempts']++;
       
        if ($_SESSION['client']['attempts'] >= 999999999)
        {
            mysql_query("UPDATE users SET account_locked = '1' WHERE id = '{$_SESSION['user']['id']}' LIMIT 1") or die(mysql_error());
        }

        $error = true;
    }
    else
    {
        $key = true;
    }
}

if (!$key)
{
?>
<html>
    <head>
        <title>Nebbo Hotel</title>

        <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
        <link href="animate.css" rel="stylesheet" type="text/css" />

        <script src='https://www.google.com/recaptcha/api.js'></script>
        <script src="https://code.jquery.com/jquery-2.1.4.js"></script>

        </script>
        <script src="https://code.jquery.com/jquery-2.1.4.js"></script>
    </head>
    <body>
        <!--<div class="redalert">
        <div class="redmessage"><b>Keep calm and play on</b>, people are trying to <b>hack</b> us and <b>DDoS</b> us right now. It won't affect anything. Promise Enjoy:)</b></div>
        </div>-->
        <div class="logo"><div class="animated bounceInDown"><img src="http://nebbo.org/app/tpl/skins/Habbo/images/logo.png"></div></div>

        <div class="totalresolvers">
        <form action="#" class="cleanForm" method="POST" autocomplete="off">
        <div class="column">
        <input type="password" name="password" placeholder="" maxlength="12" autocomplete="off" />

        <input type="submit" value="submit"/>

        </form>
        </div>


        <div class="thold"><div class="tholdtext">Please enter '1234' above to verify you're a human being.</div></div>
        </div>





        <div class="line">
        </div>

        <!--<script>
        $("#nav").hover(function(){
        $('.redalert').fadeOut(5);
        });
        </script>

        <script>
        $("#nav").mouseleave(function(){
        $('.redalert').fadeIn(500);
        });
        </script>
        -->
    </body>
</html>
<?php
}
?>
 
Last edited:

Users who are viewing this thread

Top