Exemple #1
0
$error = '';
if (!checkdatabase()) {
    $error = "Die Datenbank ist nicht erreichbar.";
}
//Username überprüfen
if (!$error) {
    $db = db();
    $select = $db->query("SELECT * FROM user");
    while ($fetch = $select->fetchArray()) {
        if (selectuser($_SESSION['id'])['username'] != $username) {
            if ($fetch['username'] == $username) {
                $error = "Dieser Benutzername existiert schon.";
                break;
            }
        }
        if (selectuser($_SESSION['id'])['email'] != $email) {
            if ($fetch['email'] == $email) {
                $error = "Dieser Email wird bereits verwendet.";
                break;
            }
        }
    }
}
//update
if (!$error) {
    $db = db();
    $update = $db->prepare("UPDATE user SET username=:username, email=:email, password=:password, summary=:summary, pic=:pic WHERE id=:sessionuser;");
    $update->bindValue(":username", $_POST['username'], SQLITE3_TEXT);
    $update->bindValue(":password", $password, SQLITE3_TEXT);
    $update->bindValue(":email", $_POST['email'], SQLITE3_TEXT);
    $update->bindValue(":summary", $_POST['summary'], SQLITE3_TEXT);
            <button name="post">POST</button>
        </a><br>
        <br>
        <form method="post" action="lib/common.php">
            <button name="logout">LOGOUT</button>
        </form>
    </div>

<div id="main">
    <?php 
echo '<h5>Blogs</h5>';
$db = db();
$stmt = $db->prepare('SELECT * FROM post ORDER BY id DESC');
$result = $stmt->execute();
while ($fetch = $result->fetchArray()) {
    echo '<h1>' . selectuser($fetch['user_id'])['username'] . '</h1>';
    echo '<a href="postview.php?id=' . $fetch['id'] . '">';
    echo '<h3>' . $fetch['tag'] . '</h3>';
    echo '<h1>' . $fetch['title'] . '</h1>';
    echo '<h4>' . $fetch['created_at'] . '</h4>';
    ?>
        <?php 
    echo '</a>';
    echo '</div>';
}
if ($result->fetchArray() == false) {
    echo "<h2>No Entries found :( Be the first one!</h2>";
}
?>
</div>
Exemple #3
0
?>
 value="toy">toy</option>
															<option <?php 
if (selectuser($_SESSION['id'])['pic'] == 'wesley') {
    echo 'selected';
}
?>
 value="wesley">guitar guy</option>
															<option <?php 
if (selectuser($_SESSION['id'])['pic'] == 'pizza') {
    echo 'selected';
}
?>
 value="pizza">pizza</option>
															<option <?php 
if (selectuser($_SESSION['id'])['pic'] == 'bard') {
    echo 'selected';
}
?>
 value="bard">bard</option>
														</select></div>
				</div>
				<br>
				<div class="row"><div class="textalign col-xs-12"><button type="submit" name="submit">UPDATE</button></div></div>
			</form>
			<div class="row"><div class="textalign col-xs-12"><a href="view-user.php?id=<?php 
echo $_SESSION['id'];
?>
"><button type="submit" name="submit">BACK</button></a></div></div>
	</div>
	<script src="scripts/validate.js"></script>
Exemple #4
0
$stmt = $db->prepare('SELECT * FROM comments WHERE post_id = :id');
$stmt->bindValue(':id', $_GET['id'], SQLITE3_INTEGER);
$result = $stmt->execute();
while ($fetch = $result->fetchArray()) {
    ?>
						<div class="commentspace row">
						<div class="col-md-2 col-xs-4 col-sm-2 commentuser">
							<div class="nailthumb commentpic"><a href="view-user.php?id=<?php 
    echo $fetch['user_id'];
    ?>
"><img src="pics/userpics/<?php 
    echo selectuser($fetch['user_id'])['pic'];
    ?>
.jpg"></a></div>
							<h3><?php 
    echo selectuser($fetch['user_id'])['username'];
    ?>
</h3>
						</div>
						<div class="col-md-10 col-xs-8 col-sm-10 commenttext">
							<h6><?php 
    echo $fetch['created_at'];
    ?>
</h6>
							<p><?php 
    foreach (preg_split("/((\r?\n)|(\r\n?))/", $fetch['body']) as $line) {
        echo $line . '<br>';
    }
    ?>
</p>
						<?php 
Exemple #5
0
			<div class="col-md-4">
				<div class="userspace">
					<h1><?php 
echo selectuser($_GET['id'])['username'];
?>
</h1>
					<div class="nailthumb userpic"><img src="pics/userpics/<?php 
echo selectuser($_GET['id'])['pic'];
?>
.jpg"></div>
					<p>Member since <?php 
echo selectuser($_GET['id'])['member_since'];
?>
</p>
					<p><?php 
foreach (preg_split("/((\r?\n)|(\r\n?))/", selectuser($_GET['id'])['summary']) as $line) {
    echo $line . "<br>";
}
?>
</p>
					<a href="home.php"><button name="home">HOME</button></a><br>
					<?php 
if ($_GET['id'] == $_SESSION['id']) {
    ?>
							<a href="user-post.php"><button name="post">POST</button></a><br>
							<a href="user-settings.php"><button name="settings">SETTINGS</button></a><br>
							<form method="post" action="lib/common.php">
								<button name="logout">LOGOUT</button>
							</form>
						<?php 
}
Exemple #6
0
<?php

require_once 'lib/common.php';
$array = selectuser(3);
echo $array['summary'];
Exemple #7
0
<html>
<head>
    <title>Profil</title>
    <link rel="stylesheet" href="style.css">
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<?php 
if (!isset($_SESSION['id'])) {
    header("Location: http://localhost/BlogProjekt/login.php");
    exit;
}
?>

<body>
<h1><?php 
echo selectuser($_GET['id'])['username'];
?>
's World</h1>
<a href="frontpage.php">
            <button name="home">HOME</button>
</a><br>
<div id="main">

    <h1> Posts</h1>
    <div id="posts">
        <?php 
$db = db();
$stmt = $db->prepare('SELECT * FROM post WHERE user_id=:id ORDER BY id DESC');
$stmt->bindValue(':id', $_GET['id'], SQLITE3_INTEGER);
$result = $stmt->execute();
while ($fetch = $result->fetchArray()) {
<title>Untitled Document</title>
<style>

</style>
</head>

<body>
<?php 
include_once "header.php";
?>
                    <a href="logout.php">LOGOUT</a>
<h1 align="center"><marquee>History Of College</marquee></h1>
<hr />
<?php 
include_once "functions.php";
selectuser();
?>
<form id="form1" name="form1" method="post" action="">
  <table width="1075" height="389" border="0">
    <tr>
      <td width="85" height="68">&nbsp;</td>
      <td width="617">&nbsp;</td>
      <td width="351">&nbsp;</td>
    </tr>
    <tr>
      <td height="209">&nbsp;</td>
      <td><p>Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute OfPolytechnic </p>
	  <p>Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic </p><p>Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic Santiniketan Institute Of Polytechnic </p>
	   </td>
      <td>
	  <img src="hspic/hspic1.jpg"width="150"hight="50"/>
Exemple #9
0
    echo '</div></a>';
    echo '</div>';
}
if ($result->fetchArray() === false) {
    echo "<h2>There aren't any blog entries here.</h2>";
}
?>
		</div>
		<div class="col-md-4">
			<div class="userspace">
				<h1><?php 
echo selectuser($_SESSION['id'])['username'];
?>
</h1>
				<div class="nailthumb userpic"><img src="pics/userpics/<?php 
echo selectuser($_SESSION['id'])['pic'];
?>
.jpg"></div>
				<a href="view-user.php?id=<?php 
echo $_SESSION['id'];
?>
"><button name="view-user">PROFILE</button></a><br>
				<form method="post" action="lib/common.php">
					<button name="logout">LOGOUT</button>
				</form>
			</div>
		</div>
	</div>

	<script type="text/javascript" src="scripts/jquery.nailthumb.1.1.js"></script>
		<script type="text/javascript">