Пример #1
0
        }
    } else {
        if (isset($_COOKIE["username"]) && isset($_COOKIE["password"])) {
            $con = mysqli_connect("localhost", "plverify", "plverify", "plverify");
            $result = mysqli_query($con, "select username, password, admin from users where username='******';");
            $tuples = mysqli_fetch_array($result);
            mysqli_free_result($result);
            mysqli_close($con);
            if ($_COOKIE["username"] === $tuples[0] && $_COOKIE["password"] === $tuples[1]) {
                if ($tuples[2] === "1") {
                    console($_COOKIE["username"]);
                } else {
                    workspace($_COOKIE["username"]);
                }
            } else {
                login();
            }
        } else {
            if (isset($_POST["subreq"])) {
                workspace();
            } else {
                login();
            }
        }
    }
}
?>
    </body>
</html>
<!-- end of index.php -->
Пример #2
0
function wordinfo($wordid)
{
    $info = getenglishwordinfo($wordid);
    if ($info == NULL || $info == false) {
        echo "Invalid Word ID";
    } else {
        ?>
		
	<fieldset><legend>Word Info</legend>
		<div class="wordinfo">
			<div>
				<strong class="word"><?php 
        echo $info['word'];
        ?>
</strong>&nbsp;&nbsp;<em><?php 
        echo $info['sycgroup'];
        ?>
</em>
				<p class="definition"><?php 
        echo $info['definition'];
        ?>
</p>
			</div>
<?php 
        if (strlen(trim($info['comment'])) > 0) {
            ?>
		
			<div>
				<table style="border: none;" cellpadding="5" cellspacing="5">
					<tr>
						<td valign="top" style="width: 5em;"><strong>Comment:</strong></td>
						<td align="left" valign="top" ><?php 
            echo trim($info['comment']);
            ?>
</td>
					</tr>
				</table>
			</div>
<?php 
        }
        ?>
		
		</div>
<?php 
        workspace();
        ?>
		
    </fieldset>
<?php 
    }
}