include iframe of nieuws
ik heb me index en daar wil ik includes in, de header en de footer zitten erin maar in het midden wil ik mijn nieuws de naam van deze is show_news.php ik dacht een iframe of include alebij werkt dit niet, zou iemand me ermee kunnen helpen?? hier is de code van de index:
de fout die ik krijg is:
Warning: include() [function.include]: Unable to access /show_nieuws.php in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/index.php on line 3
Warning: include(/show_nieuws.php) [function.include]: failed to open stream: No such file or directory in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/index.php on line 3
Warning: include() [function.include]: Failed opening '/show_nieuws.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/index.php on line 3 dit is de index ik zat te denken aan: Zie de kleurtjes: Enkele quote vergeten op regel 3.
Je bent een aanhalingsteken vergeten achter nieuws.php.
zo heb ik hem nu ook op me site
werkt nog niet ,
nu zie ik Fatal error:
Cannot redeclare doorstuur() (previously declared in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php:2) in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php on line 4
dit is de index nu :
voor het geval dat jullie functions.inc willen hier:
ja
Je bent in iedergeval vergeten goed af te sluiten. Misschien verhelpt dat de error al.
Zo dus?
Fatal error: Cannot redeclare doorstuur() (previously declared in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php:2) in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php on line 4 nog steeds,,,
Bij PHP 5 schijnt dit probleem zich voor te doen.
Je zou kunnen kijken met function_exists() of de functie al ergens anders in gebruik is. http://www.phphulp.nl/php/tutorials/4/153/270/ Zie ook de faq http://www.phphulp.nl/php/faq/#6. Welke versie van PHP gebruik je???
bij mijndomein
moet ik overschakelen naar php 4? php 5 volgens mij
SanThe.
Edit:
@Dennis: Niet Bumpen.
Je hoeft niet over te stappen. Maar zoals ik al zei moet je even kijken of de functie bestaat.
Ik zou niet kiezen voor een iframe, maar gewoon met een include werken. Maar wat lukt er niet dan? Welke code gebruik je en welke foutmelding krijg je?
Code (php)
de fout die ik krijg is:
Warning: include() [function.include]: Unable to access /show_nieuws.php in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/index.php on line 3
Warning: include(/show_nieuws.php) [function.include]: failed to open stream: No such file or directory in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/index.php on line 3
Warning: include() [function.include]: Failed opening '/show_nieuws.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/index.php on line 3
Je bent een ' vergeten en je path moet wel goed staan natuurlijk.
zo heb ik hem nu ook op me site
werkt nog niet ,
nu zie ik Fatal error:
Cannot redeclare doorstuur() (previously declared in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php:2) in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php on line 4
dit is de index nu :
Code (php)
voor het geval dat jullie functions.inc willen hier:
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
function doorstuur($var){
echo '<meta http-equiv="Refresh" content="2;url=\''.$var.'">';
}
if($rang == 'admin'){
$aantal_post_nieuws = 10;
} else if($rang == 'VIP'){
$aantal_post_nieuws = 5;
} else if($rang == 'nieuws'){
$aantal_post_nieuws = 4;
} else {
$aantal_post_nieuws = 1;
}
function knop($naam, $adres){
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td><img src="images/knop/1_1.gif"></td>';
echo '<td background="images/knop/1_2.gif"></td>';
echo '<td><img src="images/knop/1_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/knop/2_1.gif"></td>';
echo '<td background="images/knop/2_2.gif"><b><a href="'.$adres.'">'.$naam.'</a></b></td>';
echo '<td background="images/knop/2_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/knop/3_1.gif"></td>';
echo '<td background="images/knop/3_2.gif"></td>';
echo '<td><img src="images/knop/3_3.gif"></td>';
echo '</tr>';
echo '</table>';
}
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function handtek($bericht) {
$bericht = htmlspecialchars($bericht);
$bericht = stripslashes($bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("
", "<br>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
return $bericht;
}
function ubb_code($bericht) {
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = nl2br("$bericht");
$bericht = str_replace(":(", "<img src='images/smileys/sad.gif' border='0'>", $bericht);
$bericht = str_replace(":)", "<img src='images/smileys/smile.gif' border='0'>", $bericht);
$bericht = str_replace(":angry:", "<img src='images/smileys/angry.gif' border='0'>", $bericht);
$bericht = str_replace(":D", "<img src='images/smileys/biggrin.gif' border='0'>", $bericht);
$bericht = str_replace(":P", "<img src='images/smileys/tongue.gif' border='0'>", $bericht);
$bericht = str_replace(":angel:", "<img src='images/smileys/angel.gif' border='0'>", $bericht);
$bericht = str_replace(":blink:", "<img src='images/smileys/blink.gif' border='0'>", $bericht);
$bericht = str_replace(":blush:", "<img src='images/smileys/blush.gif' border='0'>", $bericht);
$bericht = str_replace(":o", "<img src='images/smileys/ohmy.gif' border='0'>", $bericht);
$bericht = str_replace(";)", "<img src='images/smileys/wink.gif' border='0'>", $bericht);
$bericht = str_replace("¬.¬", "<img src='images/smileys/glare.gif' border='0'>", $bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[Quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/Quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[php]", "[phptable]", $bericht);
$bericht = str_replace("[/php]", "[/phptable]", $bericht);
$bericht = str_replace("[phptable]", "<small>PHP:</small><br><table width=\"100%\" bgcolor=\"$kleur2\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\">", $bericht);
$bericht = str_replace("[/phptable]", "</td></tr></table>", $bericht);
$bericht = str_replace("[/td]", "</td>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
$bericht = stripslashes($bericht);
return $bericht;
}
if(isset($_SESSION['ID']) AND isset($_SESSION['hash'])){
$i_sql = 'SELECT * FROM inlog WHERE ID="'.$_SESSION['ID'].'" AND hash="'.$_SESSION['hash'].'"';
$i_result = mysql_query($i_sql) OR die (mysql_error());
if(mysql_num_rows($i_result) > 0){
$inlog = 'true';
while($r = mysql_fetch_array($i_result)){
$rang = $r['rang'];
}
} else {
$inlog = 'false';
unset($_SESSION['hash']);
unset($_SESSION['ID']);
}
} else {
$inlog = 'false';
}
?>
function doorstuur($var){
echo '<meta http-equiv="Refresh" content="2;url=\''.$var.'">';
}
if($rang == 'admin'){
$aantal_post_nieuws = 10;
} else if($rang == 'VIP'){
$aantal_post_nieuws = 5;
} else if($rang == 'nieuws'){
$aantal_post_nieuws = 4;
} else {
$aantal_post_nieuws = 1;
}
function knop($naam, $adres){
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td><img src="images/knop/1_1.gif"></td>';
echo '<td background="images/knop/1_2.gif"></td>';
echo '<td><img src="images/knop/1_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/knop/2_1.gif"></td>';
echo '<td background="images/knop/2_2.gif"><b><a href="'.$adres.'">'.$naam.'</a></b></td>';
echo '<td background="images/knop/2_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/knop/3_1.gif"></td>';
echo '<td background="images/knop/3_2.gif"></td>';
echo '<td><img src="images/knop/3_3.gif"></td>';
echo '</tr>';
echo '</table>';
}
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function handtek($bericht) {
$bericht = htmlspecialchars($bericht);
$bericht = stripslashes($bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("
", "<br>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
return $bericht;
}
function ubb_code($bericht) {
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = nl2br("$bericht");
$bericht = str_replace(":(", "<img src='images/smileys/sad.gif' border='0'>", $bericht);
$bericht = str_replace(":)", "<img src='images/smileys/smile.gif' border='0'>", $bericht);
$bericht = str_replace(":angry:", "<img src='images/smileys/angry.gif' border='0'>", $bericht);
$bericht = str_replace(":D", "<img src='images/smileys/biggrin.gif' border='0'>", $bericht);
$bericht = str_replace(":P", "<img src='images/smileys/tongue.gif' border='0'>", $bericht);
$bericht = str_replace(":angel:", "<img src='images/smileys/angel.gif' border='0'>", $bericht);
$bericht = str_replace(":blink:", "<img src='images/smileys/blink.gif' border='0'>", $bericht);
$bericht = str_replace(":blush:", "<img src='images/smileys/blush.gif' border='0'>", $bericht);
$bericht = str_replace(":o", "<img src='images/smileys/ohmy.gif' border='0'>", $bericht);
$bericht = str_replace(";)", "<img src='images/smileys/wink.gif' border='0'>", $bericht);
$bericht = str_replace("¬.¬", "<img src='images/smileys/glare.gif' border='0'>", $bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[Quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/Quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[php]", "[phptable]", $bericht);
$bericht = str_replace("[/php]", "[/phptable]", $bericht);
$bericht = str_replace("[phptable]", "<small>PHP:</small><br><table width=\"100%\" bgcolor=\"$kleur2\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\">", $bericht);
$bericht = str_replace("[/phptable]", "</td></tr></table>", $bericht);
$bericht = str_replace("[/td]", "</td>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
$bericht = stripslashes($bericht);
return $bericht;
}
if(isset($_SESSION['ID']) AND isset($_SESSION['hash'])){
$i_sql = 'SELECT * FROM inlog WHERE ID="'.$_SESSION['ID'].'" AND hash="'.$_SESSION['hash'].'"';
$i_result = mysql_query($i_sql) OR die (mysql_error());
if(mysql_num_rows($i_result) > 0){
$inlog = 'true';
while($r = mysql_fetch_array($i_result)){
$rang = $r['rang'];
}
} else {
$inlog = 'false';
unset($_SESSION['hash']);
unset($_SESSION['ID']);
}
} else {
$inlog = 'false';
}
?>
Waar staat show_nieuws.php ten opzichte van index.php?
http://www.habbosafari.com/index.php
waar de fout staat
waar de fout staat
Include je die functies niet twee keer?
Code (php)
1
2
3
2
3
function doorstuur($var){
echo '<meta http-equiv="Refresh" content="2;url=\''.$var.'\'">';
}
echo '<meta http-equiv="Refresh" content="2;url=\''.$var.'\'">';
}
Je bent in iedergeval vergeten goed af te sluiten. Misschien verhelpt dat de error al.
moet ik deze in de eerste 3 regels kwakken?
gewoon effe vervangen met wat je hebt staan op regel 2 t/m 4...
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
function doorstuur($var){
echo '<meta http-equiv="Refresh" content="2;url=\''.$var.'\'">';
}
if($rang == 'admin'){
$aantal_post_nieuws = 10;
} else if($rang == 'VIP'){
$aantal_post_nieuws = 5;
} else if($rang == 'nieuws'){
$aantal_post_nieuws = 4;
} else {
$aantal_post_nieuws = 1;
}
function knop($naam, $adres){
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td><img src="images/knop/1_1.gif"></td>';
echo '<td background="images/knop/1_2.gif"></td>';
echo '<td><img src="images/knop/1_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/knop/2_1.gif"></td>';
echo '<td background="images/knop/2_2.gif"><b><a href="'.$adres.'">'.$naam.'</a></b></td>';
echo '<td background="images/knop/2_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/knop/3_1.gif"></td>';
echo '<td background="images/knop/3_2.gif"></td>';
echo '<td><img src="images/knop/3_3.gif"></td>';
echo '</tr>';
echo '</table>';
}
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function handtek($bericht) {
$bericht = htmlspecialchars($bericht);
$bericht = stripslashes($bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("
", "<br>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
return $bericht;
}
function ubb_code($bericht) {
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = nl2br("$bericht");
$bericht = str_replace(":(", "<img src='images/smileys/sad.gif' border='0'>", $bericht);
$bericht = str_replace(":)", "<img src='images/smileys/smile.gif' border='0'>", $bericht);
$bericht = str_replace(":angry:", "<img src='images/smileys/angry.gif' border='0'>", $bericht);
$bericht = str_replace(":D", "<img src='images/smileys/biggrin.gif' border='0'>", $bericht);
$bericht = str_replace(":P", "<img src='images/smileys/tongue.gif' border='0'>", $bericht);
$bericht = str_replace(":angel:", "<img src='images/smileys/angel.gif' border='0'>", $bericht);
$bericht = str_replace(":blink:", "<img src='images/smileys/blink.gif' border='0'>", $bericht);
$bericht = str_replace(":blush:", "<img src='images/smileys/blush.gif' border='0'>", $bericht);
$bericht = str_replace(":o", "<img src='images/smileys/ohmy.gif' border='0'>", $bericht);
$bericht = str_replace(";)", "<img src='images/smileys/wink.gif' border='0'>", $bericht);
$bericht = str_replace("¬.¬", "<img src='images/smileys/glare.gif' border='0'>", $bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[Quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/Quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[php]", "[phptable]", $bericht);
$bericht = str_replace("[/php]", "[/phptable]", $bericht);
$bericht = str_replace("[phptable]", "<small>PHP:</small><br><table width=\"100%\" bgcolor=\"$kleur2\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\">", $bericht);
$bericht = str_replace("[/phptable]", "</td></tr></table>", $bericht);
$bericht = str_replace("[/td]", "</td>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
$bericht = stripslashes($bericht);
return $bericht;
}
if(isset($_SESSION['ID']) AND isset($_SESSION['hash'])){
$i_sql = 'SELECT * FROM inlog WHERE ID="'.$_SESSION['ID'].'" AND hash="'.$_SESSION['hash'].'"';
$i_result = mysql_query($i_sql) OR die (mysql_error());
if(mysql_num_rows($i_result) > 0){
$inlog = 'true';
while($r = mysql_fetch_array($i_result)){
$rang = $r['rang'];
}
} else {
$inlog = 'false';
unset($_SESSION['hash']);
unset($_SESSION['ID']);
}
} else {
$inlog = 'false';
}
?>
function doorstuur($var){
echo '<meta http-equiv="Refresh" content="2;url=\''.$var.'\'">';
}
if($rang == 'admin'){
$aantal_post_nieuws = 10;
} else if($rang == 'VIP'){
$aantal_post_nieuws = 5;
} else if($rang == 'nieuws'){
$aantal_post_nieuws = 4;
} else {
$aantal_post_nieuws = 1;
}
function knop($naam, $adres){
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td><img src="images/knop/1_1.gif"></td>';
echo '<td background="images/knop/1_2.gif"></td>';
echo '<td><img src="images/knop/1_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td background="images/knop/2_1.gif"></td>';
echo '<td background="images/knop/2_2.gif"><b><a href="'.$adres.'">'.$naam.'</a></b></td>';
echo '<td background="images/knop/2_3.gif"></td>';
echo '</tr>';
echo '<tr>';
echo '<td><img src="images/knop/3_1.gif"></td>';
echo '<td background="images/knop/3_2.gif"></td>';
echo '<td><img src="images/knop/3_3.gif"></td>';
echo '</tr>';
echo '</table>';
}
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function handtek($bericht) {
$bericht = htmlspecialchars($bericht);
$bericht = stripslashes($bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("
", "<br>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
return $bericht;
}
function ubb_code($bericht) {
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = nl2br("$bericht");
$bericht = str_replace(":(", "<img src='images/smileys/sad.gif' border='0'>", $bericht);
$bericht = str_replace(":)", "<img src='images/smileys/smile.gif' border='0'>", $bericht);
$bericht = str_replace(":angry:", "<img src='images/smileys/angry.gif' border='0'>", $bericht);
$bericht = str_replace(":D", "<img src='images/smileys/biggrin.gif' border='0'>", $bericht);
$bericht = str_replace(":P", "<img src='images/smileys/tongue.gif' border='0'>", $bericht);
$bericht = str_replace(":angel:", "<img src='images/smileys/angel.gif' border='0'>", $bericht);
$bericht = str_replace(":blink:", "<img src='images/smileys/blink.gif' border='0'>", $bericht);
$bericht = str_replace(":blush:", "<img src='images/smileys/blush.gif' border='0'>", $bericht);
$bericht = str_replace(":o", "<img src='images/smileys/ohmy.gif' border='0'>", $bericht);
$bericht = str_replace(";)", "<img src='images/smileys/wink.gif' border='0'>", $bericht);
$bericht = str_replace("¬.¬", "<img src='images/smileys/glare.gif' border='0'>", $bericht);
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[small]", "<small>", $bericht);
$bericht = str_replace("[/small]", "</small>", $bericht);
$bericht = str_replace("[Quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/Quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\" color=\"#000000\">", $bericht);
$bericht = str_replace("[/quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[php]", "[phptable]", $bericht);
$bericht = str_replace("[/php]", "[/phptable]", $bericht);
$bericht = str_replace("[phptable]", "<small>PHP:</small><br><table width=\"100%\" bgcolor=\"$kleur2\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font face=\"verdana\" class=\"ws8\">", $bericht);
$bericht = str_replace("[/phptable]", "</td></tr></table>", $bericht);
$bericht = str_replace("[/td]", "</td>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\" border=\"0\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\">\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\">", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" >\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
$bericht = stripslashes($bericht);
return $bericht;
}
if(isset($_SESSION['ID']) AND isset($_SESSION['hash'])){
$i_sql = 'SELECT * FROM inlog WHERE ID="'.$_SESSION['ID'].'" AND hash="'.$_SESSION['hash'].'"';
$i_result = mysql_query($i_sql) OR die (mysql_error());
if(mysql_num_rows($i_result) > 0){
$inlog = 'true';
while($r = mysql_fetch_array($i_result)){
$rang = $r['rang'];
}
} else {
$inlog = 'false';
unset($_SESSION['hash']);
unset($_SESSION['ID']);
}
} else {
$inlog = 'false';
}
?>
Zo dus?
Fatal error: Cannot redeclare doorstuur() (previously declared in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php:2) in /storage/mijndomein/users/044563/public/sites/www.habbosafari.com/include/function.inc.php on line 4
iemand enig ideen?
Bij PHP 5 schijnt dit probleem zich voor te doen.
Je zou kunnen kijken met function_exists() of de functie al ergens anders in gebruik is. http://www.phphulp.nl/php/tutorials/4/153/270/ Zie ook de faq http://www.phphulp.nl/php/faq/#6.
Gewijzigd op 01/01/1970 01:00:00 door Ronald Vesterink
bij mijndomein
moet ik overschakelen naar php 4?
Bumpen::
SanThe.
Edit:
SanThe schreef op 24.12.2007 10:48:
Include je die functies niet twee keer?
Gewijzigd op 01/01/1970 01:00:00 door - SanThe -
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?php
if (function_exists('doorstuur')){
echo "De functie doorstuur() bestaat.\n";
}
else{
echo "De functie doorstuur() bestaat niet!!\n";
}
?>
if (function_exists('doorstuur')){
echo "De functie doorstuur() bestaat.\n";
}
else{
echo "De functie doorstuur() bestaat niet!!\n";
}
?>