Gastenboek staat niet goed in de site

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Pagina: 1 2 3 4 5 volgende »

M de Vries

M de Vries

12/06/2010 12:52:41
Quote Anchor link
Hallo,

ik heb een site laten bouwen en omdat de centen nu op zijn ben ik zelf met een gastenboek aan de slag gegaan.
Op zich werkt het maar het wordt op de verkeerde plaats getoond. Nu weet ik dat in template.tpl wordt aangeroepen door middel van $sContent ='
Als ik dat in de code erbij zet krijg ik eerst foutmeldingen op diverse regels en uiteindelijk wordt de code als tekst getoond.
Website is www.sanizo.nl en de locatie van het gastenboek is https://www.sanizo.nl/gastenboek.php
Wie kan mij wat op weg helpen om dit goed werkend te krijgen. Alvast bedankt!

Code van 2 bestanden:

Gastenboek.php

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<?php
if (!defined('PATH'))
define('PATH', '');
include (PATH.'inc/config.php');
$sSubCategorie = 'Gastenboek';
require_once (PATH.'inc/mail/swift_required.php');
//gastenboek.php
//geeft alle berichten weer, en bevat een link naar het schrijven van een bericht.


echo"<a href=\"sgastenboek.php\">Schrijf een bericht</a>";

include("connect.php"); // Nu maken we dus een verbinding met de database.

$sql = "SELECT * FROM gastenboek";
$uitvoer = mysql_query($sql);
$aantal = mysql_num_rows($uitvoer)
or die(mysql_error());
$perpage = 10;
$page_count = ceil($aantal/$perpage);

$page = (isset($_GET['page'])) ? $_GET['page'] : 1; // als $_get[page] nog niet bestaat, dan begint je gastenboek bij pagina 1

$start = ($page * $perpage) - $perpage;
$sql = "SELECT * FROM gastenboek ORDER BY id DESC LIMIT ".$start.",".$perpage.""; //Berichten uit de database halen en deze sorteren.
$uitvoer = mysql_query($sql) or die(mysql_error());
while($data = mysql_fetch_array($uitvoer))
{

echo("Bericht geschreven door <b>".$data['naam']."</b>"); //De naam van de auteur
echo(" op " .$data['datum']);
echo(" om " .$data['tijd']);
echo"<br /><br />";
$bericht = nl2br($data['bericht']);
echo($bericht); //Het bericht zelf
echo"<br /><br /><br />";
}

echo"<br /><br />";

if ($page > 1)
{

$vorige = $page-1;
echo("<a href='gastenboek.php?page=".$vorige."'>Vorige</a> ");
}

else
{
echo("<b>Vorige </b>");
}


if ($page < ceil($aantal/$perpage))
{

$volgende = $page+1;
echo("<a href='gastenboek.php?page=".$volgende."'>Volgende</a>");
}

else
{
echo("<b>Volgende</b>");
}
{
}


require_once (PATH.'template.tpl');

*****************
dit is het 2de bestand***********************
[
b]sgastenboek.php[/b]
[
code]<?php    

if (!defined('PATH'))
define('PATH', '');
include("connect.php");
$sSubCategorie = 'Gastenboek';

if (!isset($_POST['submit']))
{

?>


<form method="post" action="" />
<table width="300" cellpadding="0" border="0">
     <tr>
       <td> Naam: </td>
       <td> <input type="text" name="naam" maxlength="30" /> </td>
     </tr>
     <tr>
       <td> Bericht: </td>
       <td> <textarea name="bericht" cols="40" rows="8"></textarea> </td>
     </tr>
     <tr>
       <td> </td>
       <td> <br /><input type="submit" value="Bericht plaatsen" name="submit" /> </td>
     </tr>
</table>

<?php

//if (regel 3)reeks afsluiten
}

else{

  $naam = $_POST['naam'];    
  $bericht = $_POST['bericht'];

  if (!$naam) {
          echo "FOUTMELDING:<br />";    
          echo "Je hebt geen naam ingevuld, maar die is wel verplicht.<br />";
          echo "<input type='submit' value='Terug' onclick='history.back(1)'>";
              }

  if(strlen($naam) > 30) {
          echo "FOUTMELDING:<br />";
          echo "Je naam mag maar 30 tekens lang zijn.<br />";
          echo "<input type='submit' value='Terug' onclick='history.back(1)'>";
              }

  if (!$bericht){ //....
          echo "FOUTMELDING:<br />";
          echo "Je hebt geen bericht ingevuld, en waar gaat het hier nou juist om? Precies!... <br />";
          echo "<input type='submit' value='Terug' onclick='history.back(1)'>";
              }

  
  $naam = str_replace("'", "`", $naam);
  $naam = htmlspecialchars($naam);
  $tijd = date("G:i");
  $datum = date("d-m-y");
  $bericht = str_replace("'", "`", $bericht);
  $bericht = htmlspecialchars($bericht);

  $sql = "INSERT INTO gastenboek (id, naam, tijd, datum, bericht)
          VALUES ('', '$naam', '$tijd', '$datum', '$bericht')"
;
  mysql_query($sql) or die(mysql_error());
}

require_once (PATH.'template.tpl');
?>
Gewijzigd op 12/06/2010 12:57:47 door M de Vries
 
PHP hulp

PHP hulp

24/04/2024 19:14:52
 
Noppes Homeland

Noppes Homeland

12/06/2010 13:01:00
Quote Anchor link
Stel je de volgende vraag eens:
welk toegevoegde waarde heeft een gastenboek voor jouw site

in mijn ogen geen enkele
 
M de Vries

M de Vries

12/06/2010 13:03:34
Quote Anchor link
Hallo, bedankt voor je snelle reactie!
Ik denk dat mijn klanten wel willen zien hoe de dienst-verlenging en service is, hoe andere klanten behandeld zijn en hoe ze het ervaren hebben, etc. dat is toch van toegevoegde waarde? Waarom denk je van niet?
 
- SanThe -

- SanThe -

12/06/2010 13:04:26
Quote Anchor link
Waarvoor is er een certificaat nodig voor www.sanizo.nl?
 
M de Vries

M de Vries

12/06/2010 13:06:59
Quote Anchor link
Thuiswinkelwaarborg, als je daar bij aangesloten wilt zijn moet je een certificaat installeren.

Is er nog iemand die inhoudelijk op mijn vraag wil reageren? :-)

Alvast bedankt!
 
- SanThe -

- SanThe -

12/06/2010 13:11:11
Quote Anchor link
Maar als ik op een onbekende site kom, die van jou bijvoorbeeld en ik moet daar een certificaat accepteren dan zal ik dat dus niet doen. Is het certificaat wel officieel erkend? Dan wordt er volgens mij niets gevraagd aan de gebruiker, nu dus wel.
 
Synaps Framework

Synaps Framework

12/06/2010 13:15:45
Quote Anchor link
Wat is deze rotzooi dan?

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
<?php
    <style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>
        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

        
        <
style type="text/css">
            ul#menu1 a {
                color:#4c4c4c;
            }
        <
/style>

?>
 
M de Vries

M de Vries

12/06/2010 13:16:04
Quote Anchor link
Certificeringsproces is nog in gang, is gisteren geïnstalleerd.
 
M de Vries

M de Vries

12/06/2010 13:18:37
Quote Anchor link
Goed om te horen dat de site meteen doorgelicht wordt. Mijn programmeur heeft me verteld dat deze "rotzooi" nodig is om het menu goed in en uit te laten klappen en te laten verkleuren.

Kan iemand nog iets met mijn vraag?
 
Synaps Framework

Synaps Framework

12/06/2010 13:22:54
Quote Anchor link
Wat een beunhaas is die programmeur dan.
Je opent elke keer een style, en style elke keer (HETZELFDE!!) element met dezelfde kleur.
 
Joost van der Meijden

Joost van der Meijden

12/06/2010 13:43:01
Quote Anchor link
Hahah, dat moet ik op school zo inleveren :') :p

Ontopic::
Je zou even moeten kijken hoe het er op een andere pagina uitziet (voorwaarden.php bijvoorbeeld) en je script op de plek zetten waar de tekst bij voorwaarden.php staat.
Gewijzigd op 12/06/2010 13:45:15 door Joost van der Meijden
 
M de Vries

M de Vries

12/06/2010 13:55:19
Quote Anchor link
Hoi Synaps:

Vertraagt het de site ook, of valt dat wel mee, en heeft het verder nog nadelige gevolgen?
 
M de Vries

M de Vries

12/06/2010 13:57:58
Quote Anchor link
Hoi Joost,

Dat heb ik gedaan en dan krijg ik 3 foutmeldingen in de code(heb ik gemarkeerd met ****)
Code:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<?php
if (!defined('PATH'))
define('PATH', '');
include (PATH.'inc/config.php');

$sSubCategorie = 'Disclaimer';

$sContent ='
<div id="info_foto" class="style9">
<div class="left_style_bold"><h2>Disclaimer</h2></div>
echo"<a href=\"sgastenboek.php\">Schrijf een bericht</a>";

include("connect.php"); // Nu maken we dus een verbinding met de database.

$sql = "SELECT * FROM gastenboek";
$uitvoer = mysql_query($sql);
$aantal = mysql_num_rows($uitvoer)
or die(mysql_error());
$perpage = 10;
$page_count = ceil($aantal/$perpage);

****$page = (isset($_GET['
page'])) ? $_GET['page'] : 1; // als $_get[page] nog niet bestaat, dan begint je gastenboek bij pagina 1

$start = ($page * $perpage) - $perpage;
$sql = "SELECT * FROM gastenboek ORDER BY id DESC LIMIT ".$start.",".$perpage.""; //Berichten uit de database halen en deze sorteren.
$uitvoer = mysql_query($sql) or die(mysql_error());
while($data = mysql_fetch_array($uitvoer))
{
echo("Bericht geschreven door <b>".$data['
naam']."</b>"); //De naam van de auteur
echo(" op " .$data['
datum']);
echo(" om " .$data['
tijd']);
echo"<br /><br />";
$bericht = nl2br($data['
bericht']);
echo($bericht); //Het bericht zelf
echo"<br /><br /><br />";
}
echo"<br /><br />";

if ($page > 1)
{
****$vorige = $page-1;
echo("<a href='
gastenboek.php?page=".$vorige."'>Vorige</a> ");
}
else
{
echo("<b>Vorige </b>");
}

if ($page < ceil($aantal/$perpage))
{
$volgende = $page+1;
****echo("<a href='
gastenboek.php?page=".$volgende."'>Volgende</a>");
}
else
{
echo("<b>Volgende</b>");
}
</div>
'
;


require_once (PATH.'template.tpl');
?>
 
Synaps Framework

Synaps Framework

12/06/2010 14:01:27
Quote Anchor link
M de Vries op 12/06/2010 13:55:19:
Hoi Synaps:

Vertraagt het de site ook, of valt dat wel mee, en heeft het verder nog nadelige gevolgen?


denk aan het bumpen svp.
het zal de laadtijd wel iets vertragen maar of je het merkt is een tweede. Denk alleen niet dat google die rotzooi leuk vind. Oftewel nadelig voor je SEO, oftewel minder goed te vinden in google welke me wel belangrijk lijkt voor een webshop.
 
Joost van der Meijden

Joost van der Meijden

12/06/2010 15:46:08
Quote Anchor link
Ik probeer even wat voor je, 1 moment :)

Edit::
Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<?php
if (!defined('PATH'))
define('PATH', '');
include (PATH.'inc/config.php');

$sSubCategorie = 'Disclaimer';

$sContent ='<div id="info_foto" class="style9">
<div class="left_style_bold"><h2>Disclaimer</h2></div>
echo"<a href=\"sgastenboek.php\">Schrijf een bericht</a>";

include("connect.php"); // Nu maken we dus een verbinding met de database.

$sql = "SELECT * FROM gastenboek";
$uitvoer = mysql_query('
.$sql.');
$aantal = mysql_num_rows('
.$uitvoer.');
$perpage = 10;
$page_count = ceil('
.$aantal.' / '.$perpage.');

$page = (isset('
.$_GET["page"].')) ? '.$_GET["page"].' : 1; // als $_get[page] nog niet bestaat, dan begint je gastenboek bij pagina 1

$start = ('
.$page.' * '.$perpage.') - '.$perpage;
$sql = "SELECT * FROM gastenboek ORDER BY id DESC LIMIT '".$start."', '".$perpage."'"; //Berichten uit de database halen en deze sorteren.
$uitvoer = mysql_query($sql) or die(mysql_error());
while($data = mysql_fetch_array($uitvoer))
{

    echo("Bericht geschreven door <b>".$data['naam']."</b>"); //De naam van de auteur
    echo(" op " .$data['datum']);
    echo(" om " .$data['tijd']);
    echo"<br /><br />";
    $bericht = nl2br($data['bericht']);
    echo($bericht); //Het bericht zelf
    echo"<br /><br /><br />";
}

echo"<br /><br />";

if ($page > 1)
{

    $vorige = $page-1;
    echo("<a href='gastenboek.php?page=".$vorige."'>Vorige</a> ");
}

else
{
    echo("<b>Vorige </b>");
}


if ($page < ceil($aantal/$perpage))
{

    $volgende = $page+1;
    echo("<a href='gastenboek.php?page=".$volgende."'>Volgende</a>");
}

else
{
    echo("<b>Volgende</b>");
}

echo "</div>";
';
require_once (PATH.'
template.tpl');
?>

Met zoiets moet u in de buurt komen denk ik? :)

Maar wat zijn de foutmeldingen?

Edit2::
Van al die haakjes snap ik ook nix (waarom het gebruikt word dan) het heeft geen enkele toegevoegde waarde. Ik snap die programmeur van u echt niet.
En het kan allemaal een stuk makkelijker denk ik..
Gewijzigd op 12/06/2010 15:56:14 door Joost van der Meijden
 
M de Vries

M de Vries

12/06/2010 16:07:41
Quote Anchor link
Dank je wel voor het meedenken.

Ik krijg nu alleen nog een foutmelding op de een na laatste regel:

$volgende = $page+1;
echo("<a href='gastenboek.php?page=".$volgende."'>Volgende</a>");
}
else
{
echo("<b>Volgende</b>");
}
echo "</div>";
';
****require_once (PATH.'template.tpl');

?>

Enig idee?
 
Joost van der Meijden

Joost van der Meijden

12/06/2010 16:13:28
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
if ($page < ceil($aantal/$perpage))
{

    $volgende = $page+1;
    echo("<a href='gastenboek.php?page=".$volgende."'>Volgende</a>");
}

else
{
    echo("<b>Volgende</b>");
}

echo "</div>";
';
require_once (PATH."template.tpl");
?>


Ik heb zo een vermoeden dat dit uw probleem op zal lossen (die onderste regel heb ik alleen aangepast van ' (enkele quotes) naar " (dubbele quotes).
In uw script staat dat op regel nummer 58 :)
Gewijzigd op 12/06/2010 16:14:47 door Joost van der Meijden
 
Noppes Homeland

Noppes Homeland

12/06/2010 16:21:57
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
if ($page < ceil($aantal/$perpage))
{

    $volgende = $page+1;
    echo '<a href="gastenboek.php?page='.$volgende.'">Volgende</a>';
}

else
{
    echo '<b>Volgende</b>';
}

echo '</div>';

require_once PATH.'template.tpl';
?>


strings quoten we bij voorkeur met enkele quotes. html attribuutwaarde met "", functies welke feitelijk geen functies zijn gebruik je de () niet.

Overigens zal het mij verbazen als het quoten het probleem zal oplossen!

"Ik krijg nu alleen nog een foutmelding op de een na laatste regel:"
En zolang jij verdomt ons de php parse error te geven valt het natuurlijk ook niet uit te leggen hoe je je probleem moet oplossen.
Gewijzigd op 12/06/2010 16:22:30 door Noppes Homeland
 
Joost van der Meijden

Joost van der Meijden

12/06/2010 16:24:46
Quote Anchor link
In zijn volledige script is toch duidelijk te zien dat in de variabele $sContent alle content komt te staan.
Deze variabel moet ook afgesloten worden, vandaar dat ik op regel 13 die '; heb, en dat die quotes dus waarschijnlijk wél het probleem op zullen lossen.
Gewijzigd op 12/06/2010 16:25:28 door Joost van der Meijden
 
M de Vries

M de Vries

12/06/2010 16:26:05
Quote Anchor link
Als ik dat doe krijg ik deze fout melding:
Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/sanizo.nl/public_html/gastenboek.php on line 57
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''', ''' at line 1

Enig idee?
 
Joost van der Meijden

Joost van der Meijden

12/06/2010 16:27:48
Quote Anchor link
Dan zou je heel even je regel moeten plakken plak 4 regels boven lijn 57, lijn 57 zelf, en 4 regels onder lijn 57 even.
Dan kunnen we even precies kijken wat er fout gaat :)
 

Pagina: 1 2 3 4 5 volgende »



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.