ik heb hulp nodig met een include
ik wil met een database een include aansturen en zodat als er onderhoud aan de site word gepleegd dat dan de site offline gaat tot dat de vooraf ingevoerde datum die in de database staat is verlopen.
nu heb ik het met
opgeloste de query werkt prima hij rekend de aantal dagen uit tot het einde van het onderhoud. en als de waarde negatief word dan wil ik dat de uiteindelijke pagina gastenboek.php word weergegeven.
dat heb ik zo opgelost:
Code (php)
maar gastenboek word niet weergegeven ook al verwissel ik gastenboek.php en onderhoud.php dus dat gastenboek.php onderaan staat.
volledige pagina zie hieronder:
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
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
<?php virtual('/gastenboek/Connections/gastenboek.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT DATEDIFF(eind,NOW()) FROM Admin_onderhoud WHERE eind > 0 ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if($var_domeinnaam['domeinnaam']== 'gastenboek'){
include('gastenboek.php');
}else{
include('onderhoud.php');
}
?>
</body>
</html>
<?php
mysql_free_result($onderhoud);
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT DATEDIFF(eind,NOW()) FROM Admin_onderhoud WHERE eind > 0 ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if($var_domeinnaam['domeinnaam']== 'gastenboek'){
include('gastenboek.php');
}else{
include('onderhoud.php');
}
?>
</body>
</html>
<?php
mysql_free_result($onderhoud);
?>
u kunt ook eventjes kijken voor de errors op http://www.weesenbeek.nl/gastenboek/
Gewijzigd op 01/01/1970 01:00:00 door Willem van weesenbeek
waar haal jij nou $var_domeinnaam vandaan?
als de ingevoerde waarde -1 is dan moet hij gastenboek weergeven.
als de ingevoerde waarde 1 is dan moet hij onderhoud weergeven
je kunt van te voren invoeren hoeveel dagen het onderhoud gaat plaatsvinden
dus als
1 of meer tenopzichte van dan moet de pagina onderhoud.php weergeven.
dan krijg je deze code
Code (php)
of niet want ik kom er niet uit.
Warning: mysql_free_result(): 9 is not a valid MySQL result resource in /home/weesenbeek/domains/weesenbeek.nl/public_html/gastenboek/index.php on line 61
hieronder de index:
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
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
<?php virtual('/gastenboek/Connections/gastenboek.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT DATEDIFF(eind,NOW()) FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
mysql_select_db($database_gastenboek, $gastenboek);
$query_duur = "SELECT duur FROM Admin_onderhoud ORDER BY id DESC";
$duur = mysql_query($query_duur, $gastenboek) or die(mysql_error());
$row_duur = mysql_fetch_assoc($duur);
$totalRows_duur = mysql_num_rows($duur);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if($var_onderhoud['DATEDIFF(eind'] >0){
include('gastenboek.php');
}else{
include('onderhoud.php');
}
?>
</body>
</html>
<?php
mysql_free_result($onderhoud);
mysql_free_result($duur);
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT DATEDIFF(eind,NOW()) FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
mysql_select_db($database_gastenboek, $gastenboek);
$query_duur = "SELECT duur FROM Admin_onderhoud ORDER BY id DESC";
$duur = mysql_query($query_duur, $gastenboek) or die(mysql_error());
$row_duur = mysql_fetch_assoc($duur);
$totalRows_duur = mysql_num_rows($duur);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if($var_onderhoud['DATEDIFF(eind'] >0){
include('gastenboek.php');
}else{
include('onderhoud.php');
}
?>
</body>
</html>
<?php
mysql_free_result($onderhoud);
mysql_free_result($duur);
?>
onderhoud.php werkt goed maar krijg foutmelding maar ik zie niet wat het is een spatie of iets ???
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
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
<?php virtual('/gastenboek/Connections/gastenboek.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
mysql_select_db($database_gastenboek, $gastenboek);
$query_berekening = "SELECT DATEDIFF(eind,NOW()) FROM Admin_onderhoud ORDER BY id DESC";
$berekening = mysql_query($query_berekening, $gastenboek) or die(mysql_error());
$row_berekening = mysql_fetch_assoc($berekening);
$totalRows_berekening = mysql_num_rows($berekening);
?>
<style type="text/css">
<!--
@import url("/gastenboek/css/teken.css");
-->
</style>
</head>
<body>
<table width="50%" border="0" align="center" class="teken">
<tr>
<td><p align="left">Er is onderhoud gepland voor deze pagina. De pagina zal gedurende het onderhoud niet naar behoren werken. Mogelijk zal dit resulteren in dataverlies. </p>
<p align="left">Onze excuses hiervoor.</p>
<p align="left">We hebben <?php echo $row_onderhoud['duur']; ?> dag(en) gepland.</p>
<p align="left">U moet nog <?php echo $row_berekening['DATEDIFF(eind,NOW())']; ?> dag(en) wachten.</p></td>
</tr>
</table>
<?php
mysql_free_result($onderhoud);
mysql_free_result($berekening);
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
mysql_select_db($database_gastenboek, $gastenboek);
$query_berekening = "SELECT DATEDIFF(eind,NOW()) FROM Admin_onderhoud ORDER BY id DESC";
$berekening = mysql_query($query_berekening, $gastenboek) or die(mysql_error());
$row_berekening = mysql_fetch_assoc($berekening);
$totalRows_berekening = mysql_num_rows($berekening);
?>
<style type="text/css">
<!--
@import url("/gastenboek/css/teken.css");
-->
</style>
</head>
<body>
<table width="50%" border="0" align="center" class="teken">
<tr>
<td><p align="left">Er is onderhoud gepland voor deze pagina. De pagina zal gedurende het onderhoud niet naar behoren werken. Mogelijk zal dit resulteren in dataverlies. </p>
<p align="left">Onze excuses hiervoor.</p>
<p align="left">We hebben <?php echo $row_onderhoud['duur']; ?> dag(en) gepland.</p>
<p align="left">U moet nog <?php echo $row_berekening['DATEDIFF(eind,NOW())']; ?> dag(en) wachten.</p></td>
</tr>
</table>
<?php
mysql_free_result($onderhoud);
mysql_free_result($berekening);
?>
Boven aan je script. Het barst echt van de fouten. Ga dan netjs alle variablelen declareren en rare opbouw veranderen.
Succes!
index.php
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
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
<?php virtual('/gastenboek/Connections/gastenboek.php'); ?>
<?php virtual('/gastenboek/Connections/gastenboek.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
[code]<?php
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT DATEDIFF(eind,NOW())AS verschil FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
?>
mysql_select_db($database_gastenboek, $gastenboek);
$query_duur = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$duur = mysql_query($query_duur, $gastenboek) or die(mysql_error());
$row_duur = mysql_fetch_assoc($duur);
$totalRows_duur = mysql_num_rows($duur);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
// Turn off all error reporting
error_reporting(1);
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
if($var_onderhoud['verschil'] >0){
include('gastenboek.php');
}else{
include('onderhoud.php');
}
?>
</body>
</html>
<?php
mysql_free_result($onderhoud);
mysql_free_result($duur);
?>
<?php virtual('/gastenboek/Connections/gastenboek.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
[code]<?php
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT DATEDIFF(eind,NOW())AS verschil FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
?>
mysql_select_db($database_gastenboek, $gastenboek);
$query_duur = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$duur = mysql_query($query_duur, $gastenboek) or die(mysql_error());
$row_duur = mysql_fetch_assoc($duur);
$totalRows_duur = mysql_num_rows($duur);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
// Turn off all error reporting
error_reporting(1);
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
if($var_onderhoud['verschil'] >0){
include('gastenboek.php');
}else{
include('onderhoud.php');
}
?>
</body>
</html>
<?php
mysql_free_result($onderhoud);
mysql_free_result($duur);
?>
gastenboek.php
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
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
<?php
// Turn off all error reporting
error_reporting(0);
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
?>
<body>
motherfucker
</body>
</html>
// Turn off all error reporting
error_reporting(0);
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
?>
<body>
motherfucker
</body>
</html>
onderhoud.php
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
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
<?php virtual('/gastenboek/Connections/gastenboek.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_datediff = "SELECT DATEDIFF(EIND,NOW())AS verschil FROM Admin_onderhoud ";
$datediff = mysql_query($query_datediff, $gastenboek) or die(mysql_error());
$row_datediff = mysql_fetch_assoc($datediff);
$totalRows_datediff = mysql_num_rows($datediff);
[code]<?php
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
?>
?>
<link href="/gastenboek/css/teken.css" rel="stylesheet" type="text/css" />
<table width="75%" border="0" align="center" class="teken">
<tr>
<td><div align="center">Aan deze site vind onderhoud plaats. </div></td>
</tr>
<tr>
<td><div align="center">Einddatum onderhoud: <?php echo $row_onderhoud['eind']; ?></div>
<div align="center"></div></td>
</tr>
<tr>
<td><div align="center">We zijn over <?php echo $row_datediff['verschil']; ?> dag(en) weer online onze excuses.</div></td>
</tr>
</table>
<?php
mysql_free_result($datediff);
mysql_free_result($onderhoud);
?>
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_gastenboek, $gastenboek);
$query_datediff = "SELECT DATEDIFF(EIND,NOW())AS verschil FROM Admin_onderhoud ";
$datediff = mysql_query($query_datediff, $gastenboek) or die(mysql_error());
$row_datediff = mysql_fetch_assoc($datediff);
$totalRows_datediff = mysql_num_rows($datediff);
[code]<?php
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
?>
?>
<link href="/gastenboek/css/teken.css" rel="stylesheet" type="text/css" />
<table width="75%" border="0" align="center" class="teken">
<tr>
<td><div align="center">Aan deze site vind onderhoud plaats. </div></td>
</tr>
<tr>
<td><div align="center">Einddatum onderhoud: <?php echo $row_onderhoud['eind']; ?></div>
<div align="center"></div></td>
</tr>
<tr>
<td><div align="center">We zijn over <?php echo $row_datediff['verschil']; ?> dag(en) weer online onze excuses.</div></td>
</tr>
</table>
<?php
mysql_free_result($datediff);
mysql_free_result($onderhoud);
?>
de database bevat een waarde dus onderhoud.php word nu weergegeven
met deze fouten.
Notice: Undefined variable: var_onderhoud in /home/weesenbeek/domains/weesenbeek.nl/public_html/gastenboek/index.php on line 1187668352
Aan deze site vind onderhoud plaats.
Einddatum onderhoud: 2007-12-22
We zijn over 1 dag(en) weer online onze excuses.
Warning: mysql_free_result(): 10 is not a valid MySQL result resource in /home/weesenbeek/domains/weesenbeek.nl/public_html/gastenboek/index.php on line 82
ik gebruik deze querys
om de dagen uit te rekenen en deze gebruik ik ook bij de include
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
mysql_select_db($database_gastenboek, $gastenboek);
$query_datediff = "SELECT DATEDIFF(EIND,NOW())AS verschil FROM Admin_onderhoud ";
$datediff = mysql_query($query_datediff, $gastenboek) or die(mysql_error());
$row_datediff = mysql_fetch_assoc($datediff);
$totalRows_datediff = mysql_num_rows($datediff);
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
$query_datediff = "SELECT DATEDIFF(EIND,NOW())AS verschil FROM Admin_onderhoud ";
$datediff = mysql_query($query_datediff, $gastenboek) or die(mysql_error());
$row_datediff = mysql_fetch_assoc($datediff);
$totalRows_datediff = mysql_num_rows($datediff);
mysql_select_db($database_gastenboek, $gastenboek);
$query_onderhoud = "SELECT * FROM Admin_onderhoud ORDER BY id DESC";
$onderhoud = mysql_query($query_onderhoud, $gastenboek) or die(mysql_error());
$row_onderhoud = mysql_fetch_assoc($onderhoud);
$totalRows_onderhoud = mysql_num_rows($onderhoud);
die zijn op alle pagina's hetzelfde
Gewijzigd op 01/01/1970 01:00:00 door willem van weesenbeek