Witte pagina
Iemand een idee waar het foutloopt?
<title>Zoeken Clubs</title>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/******************
*Initialisatie
*******************/
$_srv = $_SERVER['PHP_SELF'];
/******************
* autoload
******************/
function __autoload($className) {
require_once "../klassen/$className.class.php";
}
include("../connections/pdo.inc.php");
include("../php_lib/menu.inc.php");
try
{
// toon formulier
if (! isset($_POST["submit"])) // geen formulier
{
$_output .= "<form id='club' method='post' action='$_srv'>";
$_output=
$_resultclub = $_PDO -> query("select * from t_club;");
if ($_resultclub -> rowCount() > 0)
{
$_output.= "<label>Club</label><select name='club'><option></option>";
while ($_row = $_resultclub -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "<option value=" . $_row['d_naam'].">" .$_row['d_naam'] . "</option>";
}
$_output.= "</select>";
}
$_output .="<label>Omschrijving </label>
<input type='text' name='search' size='30'>";
$_output.= "<input type='submit' name='submit' value='zoeken'><hr>
</form>";
}
else
{
if (!isset($_POST["$_srv"])){
// search zoekwoord, merken, soort, maxprijs, foto
/* $_onbekende =$_POST["search"];*/
/* $_type = $_POST["type"];*/
$_club = $_POST["club"];
/* $_categorie = $_POST["categorie"];
$_prijsexc = $_POST["prijsexc"];
$_voorraad = (isset($_POST['voorraad']))?$_POST['voorraad']:NULL;
$_foto = (isset($_POST['foto']))?$_POST['foto']:NULL;
$_leverancier = $_POST['leverancier'];
$_bouwjaar = $_POST['bouwjaar'];*/
// query (mogelijk via switch? $_POST inlezen?)
$_query = "select * from t_club WHERE 1=1";
if ($_club == ""){ }else{ $_query .= " And Club = '$_club'";}
$_result = $_PDO -> query($_query .";");
if ($_result -> rowCount() > 0)
{
$_output.= "";
while ($_row = $_result -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "
<strong>".$_row['club']."</strong><br/>";
}
/* $_output.= "</table>";*/
}
else
{
$_output = "<br><br><h2>Geen records gevonden </h2>";
}
}
}
// Object instantieren
$_smarty = new My_smarty();
// We kennen de variabelen toe
$_smarty->assign('menuh',menu('H'));
$_smarty->assign('menuv',menu(1));
$_smarty->assign('inhoud', $_output);
// display it
$_smarty->display('test.tpl');
}
catch (myException $e)
{
log("../log/logfile.csv");
errorMessage();
}
?>
/******************
*Initialisatie
*******************/
$_srv = $_SERVER['PHP_SELF'];
/******************
* autoload
******************/
function __autoload($className) {
require_once "../klassen/$className.class.php";
}
include("../connections/pdo.inc.php");
include("../php_lib/menu.inc.php");
try
{
// toon formulier
if (! isset($_POST["submit"])) // geen formulier
{
$_output .= "<form id='club' method='post' action='$_srv'>";
$_output=
$_resultclub = $_PDO -> query("select * from t_club;");
if ($_resultclub -> rowCount() > 0)
{
$_output.= "<label>Club</label><select name='club'><option></option>";
while ($_row = $_resultclub -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "<option value=" . $_row['d_naam'].">" .$_row['d_naam'] . "</option>";
}
$_output.= "</select>";
}
$_output .="<label>Omschrijving </label>
<input type='text' name='search' size='30'>";
$_output.= "<input type='submit' name='submit' value='zoeken'><hr>
</form>";
}
else
{
if (!isset($_POST["$_srv"])){
// search zoekwoord, merken, soort, maxprijs, foto
/* $_onbekende =$_POST["search"];*/
/* $_type = $_POST["type"];*/
$_club = $_POST["club"];
/* $_categorie = $_POST["categorie"];
$_prijsexc = $_POST["prijsexc"];
$_voorraad = (isset($_POST['voorraad']))?$_POST['voorraad']:NULL;
$_foto = (isset($_POST['foto']))?$_POST['foto']:NULL;
$_leverancier = $_POST['leverancier'];
$_bouwjaar = $_POST['bouwjaar'];*/
// query (mogelijk via switch? $_POST inlezen?)
$_query = "select * from t_club WHERE 1=1";
if ($_club == ""){ }else{ $_query .= " And Club = '$_club'";}
$_result = $_PDO -> query($_query .";");
if ($_result -> rowCount() > 0)
{
$_output.= "";
while ($_row = $_result -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "
<strong>".$_row['club']."</strong><br/>";
}
/* $_output.= "</table>";*/
}
else
{
$_output = "<br><br><h2>Geen records gevonden </h2>";
}
}
}
// Object instantieren
$_smarty = new My_smarty();
// We kennen de variabelen toe
$_smarty->assign('menuh',menu('H'));
$_smarty->assign('menuv',menu(1));
$_smarty->assign('inhoud', $_output);
// display it
$_smarty->display('test.tpl');
}
catch (myException $e)
{
log("../log/logfile.csv");
errorMessage();
}
?>
Die witte pagina krijg je te zien omdat ergens een fatal error is opgetreden. Als je je errorreporting inschakelt dan kun je zien wat de foutmelding is.
En hoe schakel ik error reporting in?
Gewijzigd op 31/05/2013 21:33:15 door Jan Koehoorn
Serverfout
Er is een fout opgetreden toen de website http://bert.sna-webo.be/scripts/club_lezen.php probeerde op te halen. De server kan offline zijn wegens onderhoud of kan onjuist zijn geconfigureerd.
Hier zijn enkele suggesties:
Laad deze webpagina later opnieuw.
HTTP-fout 500 (Internal Server Error): Er is een onverwachte voorwaarde gevonden toen de server het verzoek wilde uitvoeren.
Ik heb dus nog geen enkel idee wat er mis is
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
error_reporting ( E_ALL );
/******************
?php
/******************
*Initialisatie
*******************/
$_srv = $_SERVER['PHP_SELF'];
/******************
* autoload
******************/
function __autoload($className) {
require_once "../klassen/$className.class.php";
}
include("../connections/pdo.inc.php");
include("../php_lib/menu.inc.php");
try
{
// toon formulier
if (! isset($_POST["submit"])) // geen formulier
{
//
$_output .= "<form id='club' method='post' action='$_srv'><fieldset><legend>Club opzoeken</legend>";
$_output=
$_resultclub = $_PDO -> query("select * from t_club;");
if ($_resultclub -> rowCount() > 0)
{
$_output.= "<label>Club</label><select name='club'><option></option>";
while ($_row = $_resultclub -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "<option value=" . $_row['d_naam'].">" .$_row['d_naam'] . "</option>";
}
$_output.= "</select>";
}
$_output.= "<input type='submit' name='submit' value='zoeken'></fieldset>
</form>";
}
/* else
{
if (!isset($_POST["$_srv"])){
// search zoekwoord, merken, soort, maxprijs, foto
/* $_onbekende =$_POST["search"];*/
/* $_type = $_POST["type"];*/
/* $_club = $_POST["club"];
/* $_categorie = $_POST["categorie"];
$_prijsexc = $_POST["prijsexc"];
$_voorraad = (isset($_POST['voorraad']))?$_POST['voorraad']:NULL;
$_foto = (isset($_POST['foto']))?$_POST['foto']:NULL;
$_leverancier = $_POST['leverancier'];
$_bouwjaar = $_POST['bouwjaar'];*/
// query (mogelijk via switch? $_POST inlezen?)
/* $_query = "select * from t_club WHERE 1=1";
if ($_club == ""){ }else{ $_query .= " And Club = '$_club'";}
$_result = $_PDO -> query($_query .";");
if ($_result -> rowCount() > 0)
{
$_output.= "";
while ($_row = $_result -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "
<strong>".$_row['club']."</strong><br/>";
}
/* $_output.= "</table>";*/
/* }
else
{
$_output = "<br><br><h2>Geen records gevonden </h2>";
}
}
}*/
// Object instantieren
$_smarty = new My_smarty();
// We kennen de variabelen toe
$_smarty->assign('menuh',menu('H'));
$_smarty->assign('menuv',menu(1));
$_smarty->assign('inhoud', $_output);
// display it
$_smarty->display('test.tpl');
}
catch (myException $e)
{
log("../log/logfile.csv");
errorMessage();
}
?>
error_reporting ( E_ALL );
/******************
?php
/******************
*Initialisatie
*******************/
$_srv = $_SERVER['PHP_SELF'];
/******************
* autoload
******************/
function __autoload($className) {
require_once "../klassen/$className.class.php";
}
include("../connections/pdo.inc.php");
include("../php_lib/menu.inc.php");
try
{
// toon formulier
if (! isset($_POST["submit"])) // geen formulier
{
//
$_output .= "<form id='club' method='post' action='$_srv'><fieldset><legend>Club opzoeken</legend>";
$_output=
$_resultclub = $_PDO -> query("select * from t_club;");
if ($_resultclub -> rowCount() > 0)
{
$_output.= "<label>Club</label><select name='club'><option></option>";
while ($_row = $_resultclub -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "<option value=" . $_row['d_naam'].">" .$_row['d_naam'] . "</option>";
}
$_output.= "</select>";
}
$_output.= "<input type='submit' name='submit' value='zoeken'></fieldset>
</form>";
}
/* else
{
if (!isset($_POST["$_srv"])){
// search zoekwoord, merken, soort, maxprijs, foto
/* $_onbekende =$_POST["search"];*/
/* $_type = $_POST["type"];*/
/* $_club = $_POST["club"];
/* $_categorie = $_POST["categorie"];
$_prijsexc = $_POST["prijsexc"];
$_voorraad = (isset($_POST['voorraad']))?$_POST['voorraad']:NULL;
$_foto = (isset($_POST['foto']))?$_POST['foto']:NULL;
$_leverancier = $_POST['leverancier'];
$_bouwjaar = $_POST['bouwjaar'];*/
// query (mogelijk via switch? $_POST inlezen?)
/* $_query = "select * from t_club WHERE 1=1";
if ($_club == ""){ }else{ $_query .= " And Club = '$_club'";}
$_result = $_PDO -> query($_query .";");
if ($_result -> rowCount() > 0)
{
$_output.= "";
while ($_row = $_result -> fetch(PDO:: FETCH_ASSOC))
{
$_output.= "
<strong>".$_row['club']."</strong><br/>";
}
/* $_output.= "</table>";*/
/* }
else
{
$_output = "<br><br><h2>Geen records gevonden </h2>";
}
}
}*/
// Object instantieren
$_smarty = new My_smarty();
// We kennen de variabelen toe
$_smarty->assign('menuh',menu('H'));
$_smarty->assign('menuv',menu(1));
$_smarty->assign('inhoud', $_output);
// display it
$_smarty->display('test.tpl');
}
catch (myException $e)
{
log("../log/logfile.csv");
errorMessage();
}
?>
Kijk in je error_log, of zet display_errors op 1