Example #1
0
    $description = base64_encode($_POST['description']);
    $email = $_POST['email'];
    $pass1 = $_POST['pw1'];
    $pass2 = $_POST['pw2'];
    $errors = array();
    //Array to hold error messages
    ?>
	
	
	<?php 
    /* Server Side Validation performed here */
    /* Check if email already exists in database*/
    $emailExist = false;
    $statement = 'SELECT vendorEmail FROM Vendor';
    //Select Query
    $connection->connectToDatabase();
    //Connect to database
    $dataset = $connection->selectData($statement);
    if ($dataset->num_rows > 0) {
        // output data of each row
        while ($row = $dataset->fetch_assoc()) {
            if ($row["vendorEmail"] == $email) {
                $emailExist = true;
            }
        }
    }
    if ($emailExist) {
        array_push($errors, "Company email " . $email . " already exists.");
    }
    /* End Check Email Exists */
    /* */
<?php

session_start();
$dezeUser = '******';
include 'classes/database.php';
$dbInst = new Database();
$db = $dbInst->connectToDatabase();
// $_SESSION['notification'] = array();
// check if alt-attribuut is set & voeg dit toe;
// var_dump($dbInst->selecteerDezeUser($dezeUser));
$iedereen = $dbInst->selecteerIedereen();
?>

<!DOCTYPE HTML>
<html>
<head>
	<title>Opdracht-</title>
	<meta charset="UTF-8">
	<link href="http://web-backend.local/css/global.css"
	rel="stylesheet"><style>input { display: block; margin: 10px;} #profielfoto {max-width: 200px; display: inline-block; margin-bottom: 20px;}</style>
</head>
<body>
<h1>Gegevens wijzigen</h2>
<div id="notification"><?php 
echo var_dump($_SESSION['notification']);
?>
</div>	<?php 
var_dump($iedereen);
?>

<?php 
Example #3
0
<?php

session_start();
include 'searchresults2.php';
$database = new Database('localhost', 'onlyone', 'root', '');
// making a new database object
if (isset($_SESSION['user_id'])) {
    header("Location: profile.php");
}
if (isset($_POST['submit'])) {
    // unete podatke smestam u varijable
    $email = mysqli_real_escape_string($database->connectToDatabase(), trim($_POST['login_email']));
    $password = mysqli_real_escape_string($database->connectToDatabase(), trim($_POST['login_password']));
    //Ako nije nijedno polje prazno..
    if (!empty($email) && !empty($password)) {
        $pass = hash('sha256', $password);
        $query = mysqli_query($database->connectToDatabase(), "SELECT * FROM user_info WHERE email = '{$email}' AND password = '******' ");
        if (mysqli_num_rows($query) == 1) {
            //$query = mysqli_query($dbc, "SELECT * FROM user_info WHERE email = '$email' AND password = '******' AND status = '1'");
            //if (mysqli_num_rows($query) == 1) {
            $row = mysqli_fetch_array($query);
            $_SESSION['user_id'] = $row['user_id'];
            $_SESSION['user_name'] = $row['first_name'];
            setcookie('user_id', $row['user_id'], time() + 60 * 60 * 24 * 30);
            // expires in 30 days
            setcookie('email', $row['email'], time() + 60 * 60 * 24 * 30);
            // expires in 30 days
            header('Location: profile.php');
            //  }
        } else {
            echo "<p>Incorrect email or password</p>";
<?php

include 'searchresults2.php';
$database = new Database('localhost', 'onlyone', 'root', '');
// making a new database object
$output = '';
$searchIndex = 'search';
$query = "SELECT * FROM user_info WHERE";
//ime tabele
$result = mysqli_query($database->connectToDatabase(), $query);
?>


<html>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Your name..</title>


    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/uno.css" rel="stylesheet">
    <link href='https://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'>
  </head>
  <body class="three">

    <nav class="navbar navbar-default">
      <div class="container-fluid">