Versio

Countdown Not Working

Overzicht Reageren

Harm

Harm

04/08/2007 09:46:00
Quote Anchor link
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)
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
<?  

$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
 
PHP hulp

PHP hulp

24/05/2012 07:15:19
Gesponsorde koppelingen:
BHosted Hosting al vanaf € 1,- per maand

Controleer nu gratis jouw domeinnaam:

  
 
Jens

Jens

04/08/2007 10:00:00
Quote Anchor link
Wat is die lijn 93 en 94?
Gewijzigd op 01/01/1970 01:00:00 door Jens
 
Harm

Harm

04/08/2007 10:01:00
Quote Anchor link
printf("(Only $days day's, $hours hours, $minutes minuts and
$seconds until a thing)");
 
Jan Koehoorn

Jan Koehoorn

04/08/2007 10:07:00
Quote Anchor link
Die enkele quote bij day's mag je niet zo schrijven.
 
Harm

Harm

04/08/2007 10:12:00
Quote Anchor link
Hoe dan ??:o
 
Jens

Jens

04/08/2007 10:14:00
Quote Anchor link
Met een slash ervoor zou ik denken?
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
 
Harm

Harm

04/08/2007 10:20:00
Quote Anchor link
Ik ben ook een amateur :P
 
Jan Koehoorn

Jan Koehoorn

04/08/2007 10:23:00
Quote Anchor link
Onthou deze regeltjes:

• enkele quotes gebruiken voor strings
• vars buiten de quotes

jouw voorbeeld zo aanpasssen:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
    echo '(Only ' . $days . ' day\'s, ' . $hours . ' hours, ' . $minutes . ' minutes and ' . $seconds . ' until a thing)';
?>
 
Harm

Harm

04/08/2007 10:48:00
Quote Anchor link
Bedankt, ik zou het even proberen.
 
Harm

Harm

04/08/2007 10:52:00
Quote Anchor link
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
 



Overzicht Reageren