2017-09-22 39 views
-1

我遇到问题。当我打开我的页面,我得到一个白页,它似乎没有加载页面, 我尝试了PHP和HTML没有CSS, ,但也没有工作。希望你能帮助我!索引上的白色屏幕

在此先感谢!

的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; 
    } 
} 

希望你们知道什么是错的! (有没有错误)

问候,工作

+1

有**没有更多的支持**为'mysql_ * '函数,他们[**正式弃用**](https://wiki.php.net/rfc/mysql_deprecation),**不再维护**和[**删除**](https:// php .net/manual/en/function.mysql-connect.php#warning)在PHP 7.0.0中。您应该使用[PDO](https://php.net/pdo)或[MySQLi](https://php.net/mysqli)更新您的代码,以确保您的项目未来的功能。 –

+0

我只是好奇,但这条线是什么? 'file_get_contents(“http://d*********/includes/class.database.php”)' –

+1

_“没有错误”_ - 您是否也检查过服务器错误日志?如果您在文件中定义了ini_set和错误报告时出现分析错误,那么将不会调用这些错误,因为PHP根本无法解析文件。 –

回答

0

我是新来这一点,还在学习。所以它更多的是问题而不是回答。在打印输出语句后,我摆脱了最后一个法语大括号,并在您定义$ ouput变量之后将其移至主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>'; 
} 
?> 
<!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>