我有问题。当我打开我的页面时,我得到一个白页,看起来页面没有加载, 我试过没有CSS的php和html, 但那也不起作用。希望你能帮助我!
提前致谢!
的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;
}
}
希望你们知道出了什么问题! (没有错误)
问候,工作
答案 0 :(得分:0)
我是新手,还在学习。所以它更多的是问题而不是答案。我在打印输出声明后删除了最后一个法语括号,并在定义了$ ouput变量后将其移动到主php。我离开了他打印$ output的地方。
我在屏幕上有一个搜索框。我不知道为什么那个支架在那里。
祝你好运这是代码: (由于显而易见的原因,我不得不注释出错误的行)
<?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>