Es geht um die Seite arenahilfe.de
Ich würde dort gerne Bilder einsetzen. Könnte mir da jemand helfen?
[src=php]<?php
require_once("Connection.php");
$conn = Connection::getInstance();
function td($content) {
return "<td>" . $content . "</td>";
}
function input($value, $name, $placeholder) {
return "<div class='input-control text'><input type='text' value='" . $value . "' name='" . $name . "' placeholder='" . $placeholder . "' /></div>";
}
function hidden($content) {
return "<span class='hidden'>" . $content . "</span>";
}
function input_hidden($name, $content) {
return "<input name='" . $name . "' type='hidden' value='" . $content . "' />";
}
$logged_in = false;
if($_COOKIE["logged_in"] === "true") $logged_in = true;
elseif(isset($_POST["username"]) && isset($_POST["password"])) {
$user = $conn->query("SELECT password FROM user WHERE username = :username", array("username" => $_POST["username"]));
$user = $user->fetch(PDO::FETCH_ASSOC);
if(sha1($_POST["password"]) == $user["password"]) {
setcookie("logged_in", "true");
$logged_in = true;
}
}
if(isset($_GET["delete"])) {
$conn->query("DELETE FROM clash WHERE id = :id", array("id" => $_GET["id"]));
} elseif(isset($_POST["id"]) && (isset($_POST["user"]) && $_POST["user"] != "") && (isset($_POST["guild"]) && $_POST["guild"] != "")) {
if($_POST["id"] == 0) {
$conn->query("INSERT INTO clash (user, guild, continent, notice) VALUES (:name, :guild, :continent, :notice)",
array("name" => $_POST["user"], "guild" => $_POST["guild"], "continent" => $_POST["continent"], "notice" => $_POST["notice"]));
} else {
$conn->query("UPDATE clash SET user = :user, guild = :guild, continent = :continent, notice = :notice WHERE id = :id",
array("user" => $_POST["user"], "guild" => $_POST["guild"], "continent" => $_POST["continent"], "notice" => $_POST["notice"], "id" => $_POST["id"]));
}
}
if(isset($_GET["logout"])) {
setcookie("logged_in", "false");
$logged_in = false;
}
$entries = $conn->queryReturnArray("SELECT * FROM clash");
?>
<html>
<head>
<meta charset="UTF-8" />
<title>Clash</title>
<link href="css/metro.min.css" rel="stylesheet">
<link href="css/metro-icons.min.css" rel="stylesheet">
<link href="css/metro-schemes.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<script src="js/jquery-2.1.4.min.js" language="javascript"></script>
<script src="js/metro.min.js" language="javascript"></script>
<script src="//cdn.datatables.net/1.10.8/js/jquery.dataTables.min.js" language="javascript"></script>
<script language="javascript">
$(function() {
$("#dataTable").DataTable({
"language": {
"lengthMenu": "Zeige _MENU_ Einträge pro Seite",
"zeroRecords": "Keine Einträge vorhanden",
"info": "Zeige Seite _PAGE_ von _PAGES_",
"infoEmpty": "Keine Einträge vorhanden",
"infoFiltered": "(gefiltert von _MAX_ Einträgen)",
"search": "Suche: ",
"paginate": {
"first": "Erste",
"previous": "<<",
"next": ">>",
"last": "Letzte"
}
}
});
});
</script>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<div class="page-content container" style="margin-top: 30px">
<?php if((isset($_POST["username"]) || isset($_POST["password"])) && !$logged_in) { ?>
<h1 style="color: #AA0000;">Falsche Daten!</h1>
<?php }
if($logged_in) { ?>
<a href="?logout" class="button">Ausloggen</a><br /><br />
<table id="dataTable" class="dataTable hovered bordered border">
<thead>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</thead>
<tfoot>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</tfoot>
<tbody>
<?php
foreach($entries as $entry) {
echo "<tr><form action='index.php' method='POST'>";
echo input_hidden("id", $entry["id"]);
echo td(hidden($entry["user"]) . input($entry["user"], "user", "Username"));
echo td(hidden($entry["guild"]) . input($entry["guild"], "guild", "Gilde"));
echo td(hidden($entry["continent"]) . input($entry["continent"], "continent", "Kontinent"));
echo td(hidden($entry["notice"]) . input($entry["notice"], "notice", "Bemerkung"));
echo "<td><button class='button' type='submit'>Update</button><a href='?delete&id=" . $entry["id"] . "' class='button'>Löschen</a></td>";
echo "</form></tr>";
}
echo "<tr><form action='index.php' method='POST'>";
echo input_hidden("id", 0);
echo td(input("", "user", "Username"));
echo td(input("", "guild", "Gilde"));
echo td(input("", "continent", "Kontinent"));
echo td(input("", "notice", "Bemerkung"));
echo "<td><button class='button' type='submit'>Einfügen</button></td>";
echo "</form></tr>";
?>
</tbody>
</table>
<?php } else { ?>
<button class="button" onclick='var dialog = $("#login_dialog").data("dialog"); dialog.open()'>Login</button><br /><br />
<table id="dataTable" class="dataTable hovered bordered border">
<thead>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</thead>
<tfoot>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</tfoot>
<tbody>
<?php
foreach($entries as $entry) {
echo "<tr>";
echo input_hidden("id", $entry["id"]);
echo td($entry["user"]);
echo td($entry["guild"]);
echo td($entry["continent"]);
echo td($entry["notice"]);
echo td("");
echo "</tr>";
}
echo "<tr><form action='index.php' method='POST'>";
echo input_hidden("id", 0);
echo td(input("", "user", "Username"));
echo td(input("", "guild", "Gilde"));
echo td(input("", "continent", "Kontinent"));
echo td(input("", "notice", "Bemerkung"));
echo "<td><button class='button' type='submit'>Einfügen</button></td>";
echo "</form></tr>";
?>
</tbody>
</table>
<?php } ?>
</div>
<div data-role="dialog" id="login_dialog" class="padding20 dialog" data-close-button="true" data-overlay="true" data-overlay-color="op-dark">
<h1 class="text-light">Login</h1>
<hr class="thin" />
<br />
<form action="index.php" method="POST">
<div class="input-control text">
<input type="text" name="username" placeholder="Nutzername" />
</div>
<br />
<div class="input-control password">
<input type="password" name="password" placeholder="Passwort" />
</div>
<br />
<button class="button" type="submit">Einloggen</button>
</form>
</div>
</body>
<a href="http://www.andyhoppe.com/" title="Besucherzaehler"><img
src="http://c.andyhoppe.com/1439753883" style="border:none" alt="Besucherzaehler" /></a>
</html>[/src]
Ich würde dort gerne Bilder einsetzen. Könnte mir da jemand helfen?
[src=php]<?php
require_once("Connection.php");
$conn = Connection::getInstance();
function td($content) {
return "<td>" . $content . "</td>";
}
function input($value, $name, $placeholder) {
return "<div class='input-control text'><input type='text' value='" . $value . "' name='" . $name . "' placeholder='" . $placeholder . "' /></div>";
}
function hidden($content) {
return "<span class='hidden'>" . $content . "</span>";
}
function input_hidden($name, $content) {
return "<input name='" . $name . "' type='hidden' value='" . $content . "' />";
}
$logged_in = false;
if($_COOKIE["logged_in"] === "true") $logged_in = true;
elseif(isset($_POST["username"]) && isset($_POST["password"])) {
$user = $conn->query("SELECT password FROM user WHERE username = :username", array("username" => $_POST["username"]));
$user = $user->fetch(PDO::FETCH_ASSOC);
if(sha1($_POST["password"]) == $user["password"]) {
setcookie("logged_in", "true");
$logged_in = true;
}
}
if(isset($_GET["delete"])) {
$conn->query("DELETE FROM clash WHERE id = :id", array("id" => $_GET["id"]));
} elseif(isset($_POST["id"]) && (isset($_POST["user"]) && $_POST["user"] != "") && (isset($_POST["guild"]) && $_POST["guild"] != "")) {
if($_POST["id"] == 0) {
$conn->query("INSERT INTO clash (user, guild, continent, notice) VALUES (:name, :guild, :continent, :notice)",
array("name" => $_POST["user"], "guild" => $_POST["guild"], "continent" => $_POST["continent"], "notice" => $_POST["notice"]));
} else {
$conn->query("UPDATE clash SET user = :user, guild = :guild, continent = :continent, notice = :notice WHERE id = :id",
array("user" => $_POST["user"], "guild" => $_POST["guild"], "continent" => $_POST["continent"], "notice" => $_POST["notice"], "id" => $_POST["id"]));
}
}
if(isset($_GET["logout"])) {
setcookie("logged_in", "false");
$logged_in = false;
}
$entries = $conn->queryReturnArray("SELECT * FROM clash");
?>
<html>
<head>
<meta charset="UTF-8" />
<title>Clash</title>
<link href="css/metro.min.css" rel="stylesheet">
<link href="css/metro-icons.min.css" rel="stylesheet">
<link href="css/metro-schemes.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<script src="js/jquery-2.1.4.min.js" language="javascript"></script>
<script src="js/metro.min.js" language="javascript"></script>
<script src="//cdn.datatables.net/1.10.8/js/jquery.dataTables.min.js" language="javascript"></script>
<script language="javascript">
$(function() {
$("#dataTable").DataTable({
"language": {
"lengthMenu": "Zeige _MENU_ Einträge pro Seite",
"zeroRecords": "Keine Einträge vorhanden",
"info": "Zeige Seite _PAGE_ von _PAGES_",
"infoEmpty": "Keine Einträge vorhanden",
"infoFiltered": "(gefiltert von _MAX_ Einträgen)",
"search": "Suche: ",
"paginate": {
"first": "Erste",
"previous": "<<",
"next": ">>",
"last": "Letzte"
}
}
});
});
</script>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<div class="page-content container" style="margin-top: 30px">
<?php if((isset($_POST["username"]) || isset($_POST["password"])) && !$logged_in) { ?>
<h1 style="color: #AA0000;">Falsche Daten!</h1>
<?php }
if($logged_in) { ?>
<a href="?logout" class="button">Ausloggen</a><br /><br />
<table id="dataTable" class="dataTable hovered bordered border">
<thead>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</thead>
<tfoot>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</tfoot>
<tbody>
<?php
foreach($entries as $entry) {
echo "<tr><form action='index.php' method='POST'>";
echo input_hidden("id", $entry["id"]);
echo td(hidden($entry["user"]) . input($entry["user"], "user", "Username"));
echo td(hidden($entry["guild"]) . input($entry["guild"], "guild", "Gilde"));
echo td(hidden($entry["continent"]) . input($entry["continent"], "continent", "Kontinent"));
echo td(hidden($entry["notice"]) . input($entry["notice"], "notice", "Bemerkung"));
echo "<td><button class='button' type='submit'>Update</button><a href='?delete&id=" . $entry["id"] . "' class='button'>Löschen</a></td>";
echo "</form></tr>";
}
echo "<tr><form action='index.php' method='POST'>";
echo input_hidden("id", 0);
echo td(input("", "user", "Username"));
echo td(input("", "guild", "Gilde"));
echo td(input("", "continent", "Kontinent"));
echo td(input("", "notice", "Bemerkung"));
echo "<td><button class='button' type='submit'>Einfügen</button></td>";
echo "</form></tr>";
?>
</tbody>
</table>
<?php } else { ?>
<button class="button" onclick='var dialog = $("#login_dialog").data("dialog"); dialog.open()'>Login</button><br /><br />
<table id="dataTable" class="dataTable hovered bordered border">
<thead>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</thead>
<tfoot>
<th>User</th>
<th>Gilde</th>
<th>Kontinent</th>
<th>Bemerkung</th>
<th> </th>
</tfoot>
<tbody>
<?php
foreach($entries as $entry) {
echo "<tr>";
echo input_hidden("id", $entry["id"]);
echo td($entry["user"]);
echo td($entry["guild"]);
echo td($entry["continent"]);
echo td($entry["notice"]);
echo td("");
echo "</tr>";
}
echo "<tr><form action='index.php' method='POST'>";
echo input_hidden("id", 0);
echo td(input("", "user", "Username"));
echo td(input("", "guild", "Gilde"));
echo td(input("", "continent", "Kontinent"));
echo td(input("", "notice", "Bemerkung"));
echo "<td><button class='button' type='submit'>Einfügen</button></td>";
echo "</form></tr>";
?>
</tbody>
</table>
<?php } ?>
</div>
<div data-role="dialog" id="login_dialog" class="padding20 dialog" data-close-button="true" data-overlay="true" data-overlay-color="op-dark">
<h1 class="text-light">Login</h1>
<hr class="thin" />
<br />
<form action="index.php" method="POST">
<div class="input-control text">
<input type="text" name="username" placeholder="Nutzername" />
</div>
<br />
<div class="input-control password">
<input type="password" name="password" placeholder="Passwort" />
</div>
<br />
<button class="button" type="submit">Einloggen</button>
</form>
</div>
</body>
<a href="http://www.andyhoppe.com/" title="Besucherzaehler"><img
src="http://c.andyhoppe.com/1439753883" style="border:none" alt="Besucherzaehler" /></a>
</html>[/src]
Anhänge
Zuletzt bearbeitet: