Countdown Not Working
Edit:
Geen uitroeptekens in topictitels a.u.b.
IK heb op een andere site een countdown gevonden. Ik heb er ook al een beetje aan zitten prutsen maar hij werkt egt niet! Ik krijg telkens foutmeldingen:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?
$day = 13; // Day of the countdown
$month = 5; // Month of the countdown
$year = 2002; // Year of the countdown
// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$year);
$diff = $target - time();
$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days * 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours * 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;
printf("(Only $days day's, $hours hours, $minutes minuts and
$seconds until a thing)");
?>
$day = 13; // Day of the countdown
$month = 5; // Month of the countdown
$year = 2002; // Year of the countdown
// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$year);
$diff = $target - time();
$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days * 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours * 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;
printf("(Only $days day's, $hours hours, $minutes minuts and
$seconds until a thing)");
?>
En de foutmelding die ik krijg is:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/funky/domains/funky.v3host.nl/public_html/frame.php on line 94
Gewijzigd op 01/01/1970 01:00:00 door Harm
Wat is die lijn 93 en 94?
Gewijzigd op 01/01/1970 01:00:00 door Jens
printf("(Only $days day's, $hours hours, $minutes minuts and
$seconds until a thing)");
$seconds until a thing)");
Die enkele quote bij day's mag je niet zo schrijven.
Hoe dan ??:o
Met een slash ervoor zou ik denken?
Ik ben ook nog maar amateur, maar met een slash lukt het wel denk ik (day/'s)
Ik ben ook nog maar amateur, maar met een slash lukt het wel denk ik (day/'s)
Gewijzigd op 01/01/1970 01:00:00 door Jens
Ik ben ook een amateur :P
Onthou deze regeltjes:
• enkele quotes gebruiken voor strings
• vars buiten de quotes
jouw voorbeeld zo aanpasssen:
• enkele quotes gebruiken voor strings
• vars buiten de quotes
jouw voorbeeld zo aanpasssen:
Code (php)
1
2
3
2
3
<?php
echo '(Only ' . $days . ' day\'s, ' . $hours . ' hours, ' . $minutes . ' minutes and ' . $seconds . ' until a thing)';
?>
echo '(Only ' . $days . ' day\'s, ' . $hours . ' hours, ' . $minutes . ' minutes and ' . $seconds . ' until a thing)';
?>
Bedankt, ik zou het even proberen.
Nu geeft die op regel 94 foutmelding:
echo '(Only ' . $days . ' day\'s, ' . $hours . ' hours, ' . $minutes . ' minutes and ' . $seconds . ' until a thing)';
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /home/funky/domains/funky.v3host.nl/public_html/frame.php on line 94
echo '(Only ' . $days . ' day\'s, ' . $hours . ' hours, ' . $minutes . ' minutes and ' . $seconds . ' until a thing)';
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /home/funky/domains/funky.v3host.nl/public_html/frame.php on line 94




