Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 22 van 286

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Wil je toevallig checken of het een datum is ofzo?
Toevallig wel ja smile En ik wil dit graag niet met Jquery doen.
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Je kan het zo doen:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/var_dump"]var_dump[/URL][COLOR= #007700]([/COLOR]checkDatum[COLOR= #007700]([/COLOR][COLOR= #DD0000]2012-06-16[/COLOR][COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/var_dump"]var_dump[/URL][COLOR= #007700]([/COLOR]checkDatum[COLOR= #007700]([/COLOR][COLOR= #DD0000]abcd-ef-gh[/COLOR][COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/var_dump"]var_dump[/URL][COLOR= #007700]([/COLOR]checkDatum[COLOR= #007700]([/COLOR][COLOR= #DD0000]2012-02-30[/COLOR][COLOR= #007700]));

function[/COLOR] checkDatum[COLOR= #007700]([/COLOR][COLOR= #0000BB]$datum[/COLOR][COLOR= #007700])
{[/COLOR]
    
    [COLOR= #0000BB]$timestamp[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$datum[/COLOR][COLOR= #007700]);[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timestamp[/COLOR] [COLOR= #007700]!==[/COLOR] false[COLOR= #007700])
    {[/COLOR]
        
        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/checkdate"]checkdate[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]n[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]),[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]j[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]),[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Y[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700])) &&[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]$datum[/COLOR][COLOR= #007700];
        
    }[/COLOR]
    
    [URL="http://www.php.net/return"]return[/URL] false[COLOR= #007700];
    
}[/COLOR]


dus dan doe je

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]checkDatum[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]datum[/COLOR][COLOR= #007700]]))
{[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]foute datum[/COLOR][COLOR= #007700];
    
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]goede datum[/COLOR][COLOR= #007700];
    
}[/COLOR]
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt!!
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Lennard schreef:
Maar je moet het dan wel zo doen (let op regel 10):

[COLOR= #0000BB]<?php[/COLOR] 

[COLOR= #FF8000]// Insert this block of code at the very top of your page: [/COLOR]

[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$start[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700];[/COLOR] 

[COLOR= #FF8000]// HIER MOET DUS DE CODE VAN JE WEBSITE KOMEN[/COLOR]

[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$finish[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700];[/COLOR] 
[COLOR= #0000BB]$totaltime[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$finish[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$start[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/printf"]printf[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Deze pagina is in %f seconden geladen!."[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$totaltime[/COLOR][COLOR= #007700]);[/COLOR] 
?>
want als je alleen dat bestand include dan berekent hij alleen de parsetijd van het bestand waar hij in staat, en dat is bijna 0 altijd.

Thanks

toevoeging op 17 juni 2012, 11:56:28:
Spoiler tonen
Dylanh (link):
Lennard schreef:
Maar je moet het dan wel zo doen (let op regel 10):

[COLOR= #0000BB]<?php[/COLOR] 

[COLOR= #FF8000]// Insert this block of code at the very top of your page: [/COLOR]

[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$start[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700];[/COLOR] 

[COLOR= #FF8000]// HIER MOET DUS DE CODE VAN JE WEBSITE KOMEN[/COLOR]

[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$finish[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700];[/COLOR] 
[COLOR= #0000BB]$totaltime[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$finish[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$start[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/printf"]printf[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Deze pagina is in %f seconden geladen!."[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$totaltime[/COLOR][COLOR= #007700]);[/COLOR] 
?>
[/spoiler]
want als je alleen dat bestand include dan berekent hij alleen de parsetijd van het bestand waar hij in staat, en dat is bijna 0 altijd.

Thanks

Ik heb dus dit
load.php

[COLOR= #0000BB]<?php[/COLOR] 

[COLOR= #FF8000]// Insert this block of code at the very top of your page: [/COLOR]

[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$start[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700];[/COLOR] 
?>


pagina:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"load.php"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// code[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>


footer.php:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// Place this part at the very end of your page [/COLOR]

[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]();[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]];[/COLOR] 
[COLOR= #0000BB]$finish[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700];[/COLOR] 
[COLOR= #0000BB]$totaltime[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$finish[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$start[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/printf"]printf[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Deze pagina is in %f seconden geladen!."[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$totaltime[/COLOR][COLOR= #007700]);[/COLOR] 
?>


toevoeging op 17 juni 2012, 11:58:11:
Hoe heet een script die het aantal querys laat zien?
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heeft er iemand een host waarvan ik een mapje mag gebruiken gratis? En de FTP gegevens in PB wilt sturen? Ik heb het echt nodig heart
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
schater als ik naar footer.php ga zie ik dit:
Deze pagina is in 1339927200.755264 seconden geladen!
schaterschaterschaterschater
maar op de normale pagina is het wel gwn

toevoeging op 17 juni 2012, 12:01:03:
Sanderc schreef:
Heeft er iemand een host waarvan ik een mapje mag gebruiken gratis? En de FTP gegevens in PB wilt sturen? Ik heb het echt nodig heart
Wat wil je er op hosten?
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kleine snippets dat ik maak etc. Niks met DB ofz.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Ik maak wel ff, ik stuur zo PM
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Ik maak wel ff, ik stuur zo PM
Oke bedankt biggrin
0
Ewan

Lid

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe zorg ik hier dat mn achtergrond ook verticaal gecentreerd word? http://ewanoomen.nl/
0
Berichten
457
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thijns schreef:
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled
Klopt ook niet, hij vraagt het voor ACHTERGROND.

En hij mag best eens Googlen ja.

...valign?...
0
Berichten
457
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Spoiler tonen
Antonn (link):
Thijns schreef:
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled[/spoiler]
Klopt ook niet, hij vraagt het voor ACHTERGROND.

En hij mag best eens Googlen ja.

...valign?...

Danku voor de correctie.
Valign is volgens mij ook mogelijk, probeer maar is. wink
Background-position: center center;

0
Ewan

Lid

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Antonn schreef:
Eerdere citaten tonen
Thijns schreef:
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled

Klopt ook niet, hij vraagt het voor ACHTERGROND.

En hij mag best eens Googlen ja.

...valign?...
Je moet niet zeiken dat ik niet heb gegoogeld, daar is dit: http://reference.sitepoint.com/css/background-position uit gekomen maar dat werkt niet
Thijns schreef:
Spoiler tonen
Antonn (link):
[/quote]
Eerdere citaten tonen
Thijns schreef:
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled[/spoiler]
Klopt ook niet, hij vraagt het voor ACHTERGROND.

En hij mag best eens Googlen ja.

...valign?...

Danku voor de correctie.
Valign is volgens mij ook mogelijk, probeer maar is. wink
Background-position: center center;


Werkt dus niet
0
Berichten
457
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ewan schreef:
Spoiler tonen
Antonn (link):
[/quote]
Eerdere citaten tonen
Thijns schreef:
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled[/spoiler]
Klopt ook niet, hij vraagt het voor ACHTERGROND.

En hij mag best eens Googlen ja.

...valign?...

Je moet niet zeiken dat ik niet heb gegoogeld, daar is dit: http://reference.sitepoint.com/css/background-position uit gekomen maar dat werkt niet
Eerdere citaten tonen
Thijns schreef:
Spoiler tonen
Antonn (link):
[/quote]
Eerdere citaten tonen
Thijns schreef:
valign: middle; of vertical-align: middle; ZIE GOOGLE!!!!
Ik wist het niet meer, maar heb het binnen 23 sec. gegoogled[/spoiler]
Klopt ook niet, hij vraagt het voor ACHTERGROND.

En hij mag best eens Googlen ja.

...valign?...

Danku voor de correctie.
Valign is volgens mij ook mogelijk, probeer maar is. wink
Background-position: center center;


Werkt dus niet

http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-position
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren