-1

I have a problem. When I open my page I get a white page, it does not appear that the page is loading, I tried php and html without css, but that did not work either. Hopefully you can help me!

Thanks in advance!

INDEX.PHP

    <?php

ini_set('display_errors',1); error_reporting(E_ALL);

  file_get_contents("http://d*********/includes/class.database.php");
  session_start();
  if( !isset($_SESSION['username']) ){
  header("location:inloggen.php?login=again");
}

?>
<?php


$conn = mysqli_connect("localhost", "dutchair_bvh", "password") or die("Kon niet verbinden met de server, meld dit aan Job!");

$output = '';

// lucht
if(isset($_POST['search'])) {
    $searchq = $_POST['search'];
    $searchg = preg_replace("#[^0-9a-z]#i","",$searchq);

    $query = mysql_query("SELECT * FROM dutchair_bvh.burgers WHERE voornaam LIKE '%$searchq%' OR achternaam LIKE '%$searchq%'") or die("Zoeken mislukt");
    $count = mysql_num_rows($query);
    if($count == 0){
        $output = 'Niks gevonden in de politie database!';
    } else {
        while($row = mysql_fetch_array($query)) {
            $voornaam = $row['voornaam'];
            $achternaam = $row['achternaam'];
            $dob = $row['geboortedatum'];
            $id = $row['id'];

        }

    }

               $output .= '<div>'.$voornaam.' '.$achternaam.' '.$dob.'</div>';
?>

<link rel="shortcut icon" type="image/png" href="/favicon.png">
<title>Basisvoorziening Handhaving</title>
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="<?php echo $site; ?>styles/bvh.css">
<link rel="stylesheet" type="text/css" href="<?php echo $site; ?>styles/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="http://**************6/styles/global.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet" type="text/css" />



<meta name="viewport" content="width=device-width, initial-scale: 1.0, user-scaleable=0">
<!-- Insert this line above script imports  -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
</head>
<body>
<div id="background"></div>
    <div id="header">
        <div class="logo"><a href="<?php echo $site; ?>inloggen.php">Politie   <span>Nederland</span></a></div>  <img src="https://i.gyazo.com/92a8831641f752f13707a4e967f2d8c0.png" height="45" width="55">
    <div class="logor"><a href="<?php echo $site;?>inloggen.php">Unit Administration  <span>System</span></a></div>
        </div>

<form action="" method="post">

  <input type="text" name="search" placeholder="Zoek burger">
  <input type="submit" class="btn btn2" value="zoek" />

</form>
<?php print("$output");?>
<?php
}
?>

STYLE.CSS

body {
    background: #EDEBED
}
input[type=text] {
    width: 190px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    background-image: url('searchicon.png');
    background-position: 10px 10px; 
    background-repeat: no-repeat;
    padding: 12px 20px 12px 40px;
    -webkit-transition: width 0.4s ease-in-out;
    transition: width 0.6s ease-in-out;
}

input[type=text]:focus {
    width: 30%;
}

.btn{
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 16px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    cursor: pointer;
    background-color: white; 
    color: black; 
    border: 2px solid #008CBA;
}
.btn2 {
    background-color: white; 
    color: black; 
    border: 2px solid #008CBA;
}

.btn2:hover {
    background-color: #008CBA;
    color: white;
}

GLOBAL.CSS

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300italic,300,400italic,600,600italic,700,700italic,800,800italic);
@import url(http://fonts.googleapis.com/css?family=Roboto:400,500,700,300,100);

.login-block {
    width: 400px;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    border-top: 5px solid #264d73;
    margin: 0 auto;
}

.login-block h1 {
    text-align: center;
    color: #000;
    font-size: 18px;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 20px;
}

.login-block input {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: 'Open Sans';
    padding: 0 20px 0 50px;
    outline: none;
}

.login-block select {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: 'Open Sans';
    padding: 0 20px 0 50px;
    outline: none;
}

.login-block input#username {
    background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px top no-repeat;
    background-size: 16px 80px;
}

.login-block input#password {
    background: #fff url('http://i.imgur.com/Qf83FTt.png') 20px top no-repeat;
    background-size: 16px 80px;
}

.login-block input:active, .login-block input:focus {
    border: 1px solid #264d73;
}

.login-block button {
    width: 100%;
    height: 40px;
    background: #264d73;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #264d73;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    font-family: 'Open Sans';
    outline: none;
    cursor: pointer;
}

.login-block button:hover {
    background: #afcee9;
}

/*
.credits {
    /*margin-left: 1100px;
    margin-top: 470px;
    margin-left: -650px;
    font-size:20px;
}
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans';
}

a {
    text-decoration: none;
}
/*Start of making table*/


/*End of making table*/
div#header{
    width: 100%;
    height: 50px;
    background-color: #264d73;
    margin: 0 auto;
}


.logo {
    float: left;
    margin-top: 4px;
    margin-left: 10px;
        text-decoration: none;
}

.logor {
    float: right;
    margin-top: 4px;
    margin-right: 10px;
        text-decoration: none;
}

.logor a span {
    font-weight: 300;
        text-decoration: none;
}

.logor a {
    font-size: 1.6em;
    color: #fff;
        text-decoration: none;
}

.logoE {
    float: left;
    margin-top: 4px;
    margin-left: calc(100% - 320px);
}

.logoE a {
    font-size: 1.5em;
    color: #fff;
        text-decoration: none;
}

.logoE a span {
    font-weight: 300;
        text-decoration: none;
}

.logo a {
    font-size: 1.6em;
    color: #fff;
}

.logo a span {
    font-weight: 300;
}

input[type=submit]{
    padding:5px 20px;
    background:#ccc;
    border:0 none;
    cursor:pointer;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    margin-top: 10px;
    margin-right:auto;
    margin-left:auto;
}


div#login{
    width:600px;
    margin: 0% auto auto auto;
    font-weight: 300;
}

div#txt{
margin-top:10%;
font-family: 'Open Sans';
font-size: 100px;
color: white;
}

div#login1{
    width:600px;
    margin: 100px auto auto auto;
    font-weight: 300;
}




.content {
    width: auto;
    height: calc(100% - 86px);
    /*height: 100%;*/
    margin-left: 250px;
    background-color: #F0F0F0;
    padding: 15px;
}


a.mobile {
    display: block;
    color: #fff;
    background-color: #000;
    text-align: centre;
    padding: 7px;
}

a.mobile:active {
    background-color: #4A4A4A;

}
@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : portrait) {


    .sidebar {
        width: calc(100% + 280px);
        display: none;
                height: calc(100% + 115px);
    }

    div#txt{
        font-family: 'Open Sans';
        font-size: 100px;
        color: white;
        margin-left: 30%;
    }

    .content {
    margin-left: 0px;
    width: calc(100% + 280px);
    height: calc(100% + 320px);
    /*height: 100%;*/
    background-color: #F0F0F0;
    padding: 15px;
    }
    div#header{
        width: calc(100% + 280px);
        height: 50px;
        background-color: #264d73;
        margin: 0 auto;
    }


    a.mobile {
        /*display: none;*/
                width: calc(100% + 280px);
    }
        div#login{
            margin-bottom: 390px;
    }

}

@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) {
    .sidebar {
        width: calc(100% + 900px);
        display: none;
        height: calc(100% + 255px);
    }

    .content {
        margin-left: 0px;
                height: calc(100% + 500px);
                width: calc(100% + 900px);
    }
    div#txt{
        margin-top:1%;
        font-family: 'Open Sans';
        font-size: 100px;
        color: white;
        margin-left: 92%;
    }

    div#header{
        width: 100%;
        height: 50px;
        margin: 0 auto;
    }
    .content {
    width: calc(100% + 900px);
    height: calc(100% + 500px);
    background-color: #F0F0F0;
    padding: 15px;
    }
    .table-fill {
        background: white;
        border-radius:3px;
        border-collapse: collapse;
        height: auto;
        margin: auto;
        padding:5px;
        width: auto;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        animation: float 5s infinite;
    }
    .search {
        margin-left: 0;
        margin-top: -30px;
    }

    .searchBar {
        margin-left: 70;
        margin-top: 20px;
    }
    .logoE {
        float: left;
        margin-top: 4px;
        margin-left: calc(100% - 300px);
    }
    div#header{
        width: calc(100% + 900px);
        height: 50px;
        background-color: #264d73;
        margin: 0 auto;
    }
    .kick {
        margin-left: 100px;
        margin-top: -30px;
    }

    .note {
        margin-left: 200px;
        margin-top: -30px;
    }
    a.mobile {
                 width: calc(100% + 900px);
        /*display: none;*/
    }
        div#login{
            margin-left: 75%;
            margin-top: 20%;
            margin-bottom: 40px;
    }
}

Hope you guys know what is wrong! (There are no errors)

Greetings, Job

  • 1
    There is **no more support** for `mysql_*` functions, they are [**officially deprecated**](https://wiki.php.net/rfc/mysql_deprecation), **no longer maintained** and [**removed**](https://php.net/manual/en/function.mysql-connect.php#warning) in PHP 7.0.0. You should update your code with [PDO](https://php.net/pdo) or [MySQLi](https://php.net/mysqli) to ensure the functionality of your project in the future. – Tom Udding Sep 22 '17 at 19:45
  • I'm just curious, but what's this line for? `file_get_contents("http://d*********/includes/class.database.php")` – M. Eriksson Sep 22 '17 at 19:51
  • 1
    _"There are no errors"_ - Have you checked the servers error log as well? If you have a parse error in the file you define ini_set and error reporting, then those won't be invoked since PHP aren't able to parse the file at all. – M. Eriksson Sep 22 '17 at 19:54
  • @MagnusEriksson Thats the db connection file, with a lot of variables – Job Lechner Sep 22 '17 at 19:58
  • 1
    You do know that `file_get_contents()` doesn't include those variables into your code, right? You need `require` or `include` for that (and the file need to be accessible from your servers file system, not through an url). – M. Eriksson Sep 22 '17 at 19:59
  • @MagnusEriksson Okay thanks!! – Job Lechner Sep 22 '17 at 20:11

1 Answers1

0

I am new to this and still learning. So its more of question than answer. I got rid of the last french brace after the print output statment and moved it up to the main php after the you define your $ouput variable. I left he print $output where it was.

I got a search box on the screen. I am not sure why that brace was there at all.

good luck

Here is code: (i had to comment out lines that were giving me errors for obvious reasons)

<?php ini_set('display_errors',1); error_reporting(E_ALL);
  //file_get_contents("http://d*********/includes/class.database.php");
  session_start();
  if( !isset($_SESSION['username']) ){
 // header("location:inloggen.php?login=again");
}

?>
<?php


//$conn = mysqli_connect("localhost", "dutchair_bvh", "password") or die("Kon niet verbinden met de server, meld dit aan Job!");

$output = '';

// lucht
if(isset($_POST['search'])) {
    $searchq = $_POST['search'];
    $searchg = preg_replace("#[^0-9a-z]#i","",$searchq);

    $query = mysql_query("SELECT * FROM dutchair_bvh.burgers WHERE voornaam LIKE '%$searchq%' OR achternaam LIKE '%$searchq%'") or die("Zoeken mislukt");
    $count = mysql_num_rows($query);
    if($count == 0){
        $output = 'Niks gevonden in de politie database!';
    } else {
        while($row = mysql_fetch_array($query)) {
            $voornaam = $row['voornaam'];
            $achternaam = $row['achternaam'];
            $dob = $row['geboortedatum'];
            $id = $row['id'];

        }

    }

               $output .= '<div>'.$voornaam.' '.$achternaam.' '.$dob.'</div>';
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" type="image/png" href="/favicon.png">
<title>Basisvoorziening Handhaving</title>
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="<?php echo $site; ?>styles/bvh.css">
<link rel="stylesheet" type="text/css" href="<?php echo $site; ?>styles/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="http://**************6/styles/global.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet" type="text/css" />


<meta name="viewport" content="width=device-width, initial-scale: 1.0, user-scaleable=0">
<!-- Insert this line above script imports  -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
</head>
<body>
<div id="background"></div>
    <div id="header">
        <div class="logo"><a href="<?php echo $site; ?>inloggen.php">Politie   <span>Nederland</span></a></div>  <img src="https://i.gyazo.com/92a8831641f752f13707a4e967f2d8c0.png" height="45" width="55">
    <div class="logor"><a href="<?php echo $site;?>inloggen.php">Unit Administration  <span>System</span></a></div>
        </div>

<form action="" method="post">

  <input type="text" name="search" placeholder="Zoek burger">
  <input type="submit" class="btn btn2" value="zoek" />

</form>
<?php print("$output");?>
</body>
</html>