TUT gezocht

Gestart doorOne2xs31 reacties92 weergaven

32 berichten · pagina 2 van 3

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Afbeelding
Geen offtopic graagwink
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Waarom werkt dit niet:

[COLOR= #0000BB]<?
$huidige[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]) ?[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]last[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #0000BB]$totaal[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]];[/COLOR]
?>


want als de pagina empty is dan pakt hij auto de lastsadleynog een vraag ik heb nu dit:

[COLOR= #0000BB]<?
$perpage[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$berichten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]328[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$totaal[/COLOR]  [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$berichten[/COLOR] / [COLOR= #0000BB]$perpage[/COLOR][COLOR= #007700];[/COLOR]
?>


Maar nu krijg ik 1.8 tot 32.8 maar dat .8 moet wegemo hoe doe ik datbiggrin?

EDIT:
Oeps dubelpost
0
Berichten
592
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu deel je 328 door 10, dus dat lijkt me niet echt de bedoeling...
Hoe je het moet oplossen weet ik niet, maar misschien heb je er wat aan...

$totaal  = $berichten / $perpage;
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Dat heb ik alemo?
maar $perpage = hoeveel berichten per pagina
en $berichten is het aantal berichten
nu moet $berichten gedeeld door $perpage gedaan worden om te berekenen hoeveel paginas er moeten zijn
Toch?
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
werkt het dan wel als je 330 doet?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jep
maar hij moet het dus afronden
EDIT:
Is dit goed?:

[COLOR= #0000BB]<? $totaal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$berichten[/COLOR] / [COLOR= #0000BB]$perpage[/COLOR][COLOR= #007700]) +[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR] ?>
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik denk dat je naar boven af moet ronden.
Dus:

[COLOR= #0000BB]<?php
    $totaal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ceil"]ceil[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$berichten[/COLOR] / [COLOR= #0000BB]$perpage[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Als ik in het GLS2 forum kijk wordt er ook nog + 1 gedaan?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mja, GLS2 forum is niet echt geweldig gescript emo
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
schateren heb je ook een antwoord op
Vraag 189046
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met round() ?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik bedoelde de eerste vraag van waarom werkt dit nietemo
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$huidige = trim($_GET[p]) === ? 1 : $_GET[p] == last ? $totaal : $_GET[p];
?>
Zoiets?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
werkt niet
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$huidige[/COLOR] [COLOR= #007700]= (![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]) ?[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]: ([/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]) ===[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]: ([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]last[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #0000BB]$totaal[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]])));[/COLOR]
?>


Zo?
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