Beispiel #1
0
function blockBrowser()
{
    include "usefullInformation.php";
    $browser = new usefullInformation();
    if ($browser->getBrowser($browser->getUserAgentString()) === "Internet Explorer 9") {
        die("Features of this website aren't supported in Internet Explorer 9. Please upgrade your browser.");
    }
}
Beispiel #2
0
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button class="close" type="button" data-dismiss="modal" aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="viewModalWindowLabel">My Session</h4>
					</div>
					<div class="modal-body">
						<div class="table-responsive">
							<table class="table table-striped table-bordered">
								<tbody>
									<tr>
										<td>Your User Agent String</td>
										<td><?php 
    echo $usefulInformation->getUserAgentString();
    ?>
</td>
									</tr>
									<tr>
										<td>Your Web Browser</td>
										<td><?php 
    echo $usefulInformation->getBrowser($usefulInformation->getUserAgentString());
    ?>
</td>
									</tr>
									<tr>
										<td>Your IP Address</td>

										<td>
										<?php 
Beispiel #3
0
<?php

session_start();
include "database.php";
include "usefullInformation.php";
if (isset($_POST["username"])) {
    $information = new usefullInformation();
    $username = preg_replace("#[^a-z0-9 ]#i", "", $_POST["username"]);
    $password = preg_replace("#[^a-z0-9!?\$]#i", "", $_POST["password"]);
    $ip = $information->getIPAddress();
    $OS = $information->getOS($information->getUserAgentString());
    $d = date("d/m/o H:i:s");
    $type = "Login Error";
    $browser = $information->getBrowser($information->getUserAgentString());
    if (empty($username) && empty($password)) {
        echo "A username and password is required! This error has been recorded";
        $message = "No username or password entered";
        $error = $database->prepare("INSERT INTO `logs` (type,ip,logged_date,browser,operating_system,messages) VALUES (:type,:ip,:d,:browser,:os,:m)");
        $error->execute(array(":type" => $type, ":ip" => $ip, ":d" => $d, ":browser" => $browser, ":os" => $OS, ":m" => $message));
    } else {
        $query = $database->prepare("SELECT * FROM `users` WHERE username=:username");
        $query->execute(array(":username" => $username));
        if ($query->rowCount() > 0) {
            while ($r = $query->fetch(PDO::FETCH_OBJ)) {
                if ($r->username !== $username) {
                    echo $username . " Doesn't exist. This error has been recorded";
                    $message = "Incorrect username entered";
                    $error = $database->prepare("INSERT INTO `logs` (type,ip,logged_date,browser,operating_system,messages) VALUES (:type,:ip,:d,:browser,:os,:m)");
                    $error->execute(array(":type" => $type, ":ip" => $ip, ":d" => $d, ":browser" => $browser, ":os" => $OS, ":m" => $message));
                } else {
                    if ($r->password === md5($password)) {