Case error?
Ik kreeg van een vriend de volgende script toegestuurd. Nu ben ik niet zo handig, maar er zit een klein foutje in. Ik weet dat het een klein foutje is want ik heb het opgezocht op Google. Ik kan de fout alleen niet vinden, daarom hoop ik dat jullie het wel kunnen vinden. Het gaat om het volgende script:
Quote:
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
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
<?php
$hid = '';
if (isset($_GET['habbletKey']))
{
$hid = $_GET['habbletKey'];
}
switch (strtolower($hid))
{
case "credits":
break;
case "news":
echo "
<div class="habblet-container ">
<div id="news-habblet-container">
<div class="title">
<div class="habblet-close"></div>
<div>Het allelaatste nieuws het allereerst!</div>
</div>
<div class="content-container">
<div id="news-articles">
<ul id="news-articlelist" class="articlelist" style="display: none">
<?php
require_once('./includes/core.php');
require_once('./includes/session.php');
$getNews = dbquery("SELECT * FROM cms_news ORDER BY id DESC LIMIT 10");
$n['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true);
$oddEven = "odd";
while ($n = mysql_fetch_assoc($getNews))
{
if ($oddEven == "odd")
{
$oddEven = "even";
}
else
{
$oddEven = "odd";
}
echo '<li class="' . $oddEven . '">
<div class="news-title">' . clean($n['title']) . '</div>
<div class="news-summary">' . clean($n['summery'], true, true) . '</div>
<div class="newsitem-date">' . clean($n['time']) . '</div>
<div class="clearfix">
<a href="./articles/' . $n['id'] . '-' . $n['title_safe'] . '" target="_blank" class="article-toggle">Read on site</a>
</div>
</li>';
}
?>
</ul>
</div>
</div>
<div class="news-footer"></div>
</div>
<script type="text/javascript">
L10N.put("news.promo.readmore", "Read more").put("news.promo.close", "Close article");
News.init(false);
</script>
</div>
<!-- dependencies
<link rel="stylesheet" href="./web-gallery/v2/styles/news.css" type="text/css" />
<script src="./web-gallery/static/js/news.js" type="text/javascript"></script>
-->
";
break;
default:
print_r($_GET);
exit;
}
?>
$hid = '';
if (isset($_GET['habbletKey']))
{
$hid = $_GET['habbletKey'];
}
switch (strtolower($hid))
{
case "credits":
break;
case "news":
echo "
<div class="habblet-container ">
<div id="news-habblet-container">
<div class="title">
<div class="habblet-close"></div>
<div>Het allelaatste nieuws het allereerst!</div>
</div>
<div class="content-container">
<div id="news-articles">
<ul id="news-articlelist" class="articlelist" style="display: none">
<?php
require_once('./includes/core.php');
require_once('./includes/session.php');
$getNews = dbquery("SELECT * FROM cms_news ORDER BY id DESC LIMIT 10");
$n['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true);
$oddEven = "odd";
while ($n = mysql_fetch_assoc($getNews))
{
if ($oddEven == "odd")
{
$oddEven = "even";
}
else
{
$oddEven = "odd";
}
echo '<li class="' . $oddEven . '">
<div class="news-title">' . clean($n['title']) . '</div>
<div class="news-summary">' . clean($n['summery'], true, true) . '</div>
<div class="newsitem-date">' . clean($n['time']) . '</div>
<div class="clearfix">
<a href="./articles/' . $n['id'] . '-' . $n['title_safe'] . '" target="_blank" class="article-toggle">Read on site</a>
</div>
</li>';
}
?>
</ul>
</div>
</div>
<div class="news-footer"></div>
</div>
<script type="text/javascript">
L10N.put("news.promo.readmore", "Read more").put("news.promo.close", "Close article");
News.init(false);
</script>
</div>
<!-- dependencies
<link rel="stylesheet" href="./web-gallery/v2/styles/news.css" type="text/css" />
<script src="./web-gallery/static/js/news.js" type="text/javascript"></script>
-->
";
break;
default:
print_r($_GET);
exit;
}
?>
Gebruik bij echo enkele quotes zodat de dubbele html-quotes goed blijven.
Code (php)
Gewijzigd op 05/03/2011 20:49:34 door - SanThe -
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\habblet\cproxy.php on line 45
In plaats van:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\habblet\cproxy.php on line 44
die ik eerder had. Ik heb dit gedaan:
Quote:
case "news":
echo '
<div class="habblet-container ">
';
echo '
<div class="habblet-container ">
';
ben je niet ergens een ; vergeten?
Regel 34 wordt niet afgesloten en regel 35 kan weg.
Quote:
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
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
<?php
$hid = '';
if (isset($_GET['habbletKey']))
{
$hid = $_GET['habbletKey'];
}
switch (strtolower($hid))
{
case "credits":
break;
case "news":
echo '
<div class="habblet-container ">
<div id="news-habblet-container">
<div class="title">
<div class="habblet-close"></div>
<div>Het allerlaatste nieuws, het allereerst!</div>
</div>
<div class="content-container">
<div id="news-articles">
<ul id="news-articlelist" class="articlelist" style="display: none">
require_once('./includes/core.php');
require_once('./includes/session.php');
$getNews = dbquery("SELECT * FROM cms_news ORDER BY id DESC LIMIT 10");
$n['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true);
$oddEven = "odd";
while ($n = mysql_fetch_assoc($getNews))
{
if ($oddEven == "odd")
{
$oddEven = "even";
}
else
{
$oddEven = "odd";
}
echo '<li class="' . $oddEven . '">
<div class="news-title">' . clean($n['title']) . '</div>
<div class="news-summary">' . clean($n['summery'], true, true) . '</div>
<div class="newsitem-date">' . clean($n['time']) . '</div>
<div class="clearfix">
<a href="./articles/' . $n['id'] . '-' . $n['title_safe'] . '" target="_blank" class="article-toggle">Read on site</a>
</div>
</li>';
}
</ul>
</div>
</div>
<div class="news-footer"></div>
</div>
<script type="text/javascript">
L10N.put("news.promo.readmore", "Read more").put("news.promo.close", "Close article");
News.init(false);
</script>
</div>
<!-- dependencies
<link rel="stylesheet" href="./web-gallery/v2/styles/news.css" type="text/css" />
<script src="./web-gallery/static/js/news.js" type="text/javascript"></script>
-->
';
break;
default:
print_r($_GET);
exit;
}
?>
$hid = '';
if (isset($_GET['habbletKey']))
{
$hid = $_GET['habbletKey'];
}
switch (strtolower($hid))
{
case "credits":
break;
case "news":
echo '
<div class="habblet-container ">
<div id="news-habblet-container">
<div class="title">
<div class="habblet-close"></div>
<div>Het allerlaatste nieuws, het allereerst!</div>
</div>
<div class="content-container">
<div id="news-articles">
<ul id="news-articlelist" class="articlelist" style="display: none">
require_once('./includes/core.php');
require_once('./includes/session.php');
$getNews = dbquery("SELECT * FROM cms_news ORDER BY id DESC LIMIT 10");
$n['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true);
$oddEven = "odd";
while ($n = mysql_fetch_assoc($getNews))
{
if ($oddEven == "odd")
{
$oddEven = "even";
}
else
{
$oddEven = "odd";
}
echo '<li class="' . $oddEven . '">
<div class="news-title">' . clean($n['title']) . '</div>
<div class="news-summary">' . clean($n['summery'], true, true) . '</div>
<div class="newsitem-date">' . clean($n['time']) . '</div>
<div class="clearfix">
<a href="./articles/' . $n['id'] . '-' . $n['title_safe'] . '" target="_blank" class="article-toggle">Read on site</a>
</div>
</li>';
}
</ul>
</div>
</div>
<div class="news-footer"></div>
</div>
<script type="text/javascript">
L10N.put("news.promo.readmore", "Read more").put("news.promo.close", "Close article");
News.init(false);
</script>
</div>
<!-- dependencies
<link rel="stylesheet" href="./web-gallery/v2/styles/news.css" type="text/css" />
<script src="./web-gallery/static/js/news.js" type="text/javascript"></script>
-->
';
break;
default:
print_r($_GET);
exit;
}
?>
Met deze error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\habblet\cproxy.php on line 26
op lijn 34 sluit je niet af.
Hij begint op lijn 34 en eindigt op lijn 70
en ondertussen nog query's en require_once uitvoeren ?!
Als ik het nou zo doe:
cproxy.php
Quote:
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
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
<?php
require_once('./includes/core.php');
require_once('./includes/session.php');
$hid = '';
if (isset($_GET['habbletKey']))
{
$hid = $_GET['habbletKey'];
}
switch (strtolower($hid))
{
case "credits":
break;
case "news":
require_once('./habblet/cproxy-news.php');
break;
default:
print_r($_GET);
exit;
}
?>
require_once('./includes/core.php');
require_once('./includes/session.php');
$hid = '';
if (isset($_GET['habbletKey']))
{
$hid = $_GET['habbletKey'];
}
switch (strtolower($hid))
{
case "credits":
break;
case "news":
require_once('./habblet/cproxy-news.php');
break;
default:
print_r($_GET);
exit;
}
?>
cproxy-news.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
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
<div class="habblet-container ">
<div id="news-habblet-container">
<div class="title">
<div class="habblet-close"></div>
<div>Het allerlaatste nieuws, het allereerst!</div>
</div>
<div class="content-container">
<div id="news-articles">
<ul id="news-articlelist" class="articlelist" style="display: none" >
<?php
$getNews = dbquery("SELECT * FROM cms_news ORDER BY id DESC LIMIT 10");
$n['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true);
$oddEven = "odd";
while ($n = mysql_fetch_assoc($getNews))
{
if ($oddEven == "odd")
{
$oddEven = "even";
}
else
{
$oddEven = "odd";
}
echo '<li class="' . $oddEven . '">
<div class="news-title">' . clean($n['title']) . '</div>
<div class="news-summary">' . clean($n['summery'], true, true) . '</div>
<div class="newsitem-date">' . clean($n['time']) . '</div>
<div class="clearfix">
<a href="./articles/' . $n['id'] . '-' . $n['title_safe'] . '" target="_blank" class="article-toggle">Read on site</a>
</div>
</li>';
}
?>
</ul>
</div>
</div>
<div class="news-footer"></div>
</div>
<script type="text/javascript">
L10N.put("news.promo.readmore", "Read more").put("news.promo.close", "Close article");
News.init(false);
</script>
</div>
<!-- dependencies
<link rel="stylesheet" href="./web-gallery/v2/styles/news.css" type="text/css" />
<script src="./web-gallery/static/js/news.js" type="text/javascript"></script>
-->
<div id="news-habblet-container">
<div class="title">
<div class="habblet-close"></div>
<div>Het allerlaatste nieuws, het allereerst!</div>
</div>
<div class="content-container">
<div id="news-articles">
<ul id="news-articlelist" class="articlelist" style="display: none" >
<?php
$getNews = dbquery("SELECT * FROM cms_news ORDER BY id DESC LIMIT 10");
$n['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true);
$oddEven = "odd";
while ($n = mysql_fetch_assoc($getNews))
{
if ($oddEven == "odd")
{
$oddEven = "even";
}
else
{
$oddEven = "odd";
}
echo '<li class="' . $oddEven . '">
<div class="news-title">' . clean($n['title']) . '</div>
<div class="news-summary">' . clean($n['summery'], true, true) . '</div>
<div class="newsitem-date">' . clean($n['time']) . '</div>
<div class="clearfix">
<a href="./articles/' . $n['id'] . '-' . $n['title_safe'] . '" target="_blank" class="article-toggle">Read on site</a>
</div>
</li>';
}
?>
</ul>
</div>
</div>
<div class="news-footer"></div>
</div>
<script type="text/javascript">
L10N.put("news.promo.readmore", "Read more").put("news.promo.close", "Close article");
News.init(false);
</script>
</div>
<!-- dependencies
<link rel="stylesheet" href="./web-gallery/v2/styles/news.css" type="text/css" />
<script src="./web-gallery/static/js/news.js" type="text/javascript"></script>
-->
Kan dit dan wel? Nee, want dan krijg ik deze error:
Quote:
Warning: require_once() [function.require-once]: Unable to access ./includes/core.php in C:\xampp\htdocs\habblet\cproxy.php on line 3
Warning: require_once(./includes/core.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\habblet\cproxy.php on line 3
Fatal error: require_once() [function.require]: Failed opening required './includes/core.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\habblet\cproxy.php on line 3
Warning: require_once(./includes/core.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\habblet\cproxy.php on line 3
Fatal error: require_once() [function.require]: Failed opening required './includes/core.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\habblet\cproxy.php on line 3
Ik vat hier echt helemaal niets meer van!
Gewijzigd op 05/03/2011 21:37:35 door Bart Knippers
lees je errors, gebruik code tags, zoek op google
Nou sorry hoor, kdacht dat je twel zou snappen. En ja, hij kan de core.php niet vinden! Maar hoe fix je dat dan? Dat kan ik niet op google vinden!
Bart Knippers op 05/03/2011 21:32:20:
... No such file or directory ...
Lijkt mij toch duidelijk genoeg. Het bestand wordt niet gevonden.
- SanThe - op 05/03/2011 22:07:47:
Lijkt mij toch duidelijk genoeg. Het bestand wordt niet gevonden.
Bart Knippers op 05/03/2011 21:32:20:
... No such file or directory ...
Lijkt mij toch duidelijk genoeg. Het bestand wordt niet gevonden.
Duidelijk is hij nog NIET klaar met habbo rippen als dat bestand niet bestaat lijkt mij