Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 179 van 286

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat had je als code, wat was het resultaat en wat was er mis?
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Antonn schreef:
Wat had je als code, wat was het resultaat en wat was er mis?
Had hem verwijderd omdat die niet dee wat ik wou, Hij gaf bij mij de laste weer door explode
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Probeer dan even wat nieuws, en meld het maar als je niet weet hoe er aaan te beginnen, of als je vast loopt wink
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een klein vraagje, ik heb een if statement, en ik moet 1 waarde controleren of hij gelijk aan is 3 andere waardes ik heb nu:

[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]( ([/COLOR]user[COLOR= #007700]::[/COLOR]rank[COLOR= #007700]() ==[/COLOR] [COLOR= #0000BB]6[/COLOR][COLOR= #007700]) || ([/COLOR]user[COLOR= #007700]::[/COLOR]rank[COLOR= #007700]() ==[/COLOR] [COLOR= #0000BB]7[/COLOR][COLOR= #007700]) || ([/COLOR]user[COLOR= #007700]::[/COLOR]rank[COLOR= #007700]() ==[/COLOR] [COLOR= #0000BB]8[/COLOR][COLOR= #007700]) );[/COLOR]
?>


Kan je dit vereen voudigen??
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
if(in_array(user:rank(), array(6, 7, 8)))
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
if(user::rank() >= 6)
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
als er geen rank van 9 en hoger is dan kan dat ook indd smile
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat kan niet smile Heb het van nielsie maar dat van lennard lijkt me makkelijker, ook als er andere ranken die een heel ander specifiek nummer heeft.

Daar naast nog een vraagje.
Is er een soort substr() functie voor in de sql?
Dus als hij mijn bericht op haald dat hij alleen de eerste 15 ophaald??
ipv het hele bericht?
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Dat kan toch ook gewoon met ASC LIMIT 15??
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Dat kan toch ook gewoon met ASC LIMIT 15??
Nee, dat is om het aantal rijen te beperken.
0
Berichten
1.803
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

zou iemand mij kunnen helpen..?
iemand die een beetje verstand heeft van php en mysql is dit denk ik niet heel moeilijk.
Je krijgt er een vergoeding van 2 punten voor als je de oplossing bied!
Wanneer je een account aanmaakt op http://www.linkenplaats.nl/ en je inlogt en je gaat vervolgens naar instellingen of statastieken geeft de een notice. Kan iemand mij uitleggen hoe ik dit weg krijg? vergoeding is 2 punten!
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Als je hier de notice en stukje code plaatst gok ik dat er wat meer mensen reageren.
0
Berichten
1.803
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zal dit even opzoeken even geduld smile
toevoeging op 20 november 2012, 11:32:22:
Notice van de instellingen pagina: || Notice: Use of undefined constant mysql_num_rows - assumed mysql_num_rows in /home/timvz/domains/linkenplaats.nl/public_html/init.php on line 105

Warning van de statistieken pagina: || Warning: Creating default object from empty value in /home/timvz/domains/linkenplaats.nl/public_html/paginas/statistieken.php on line 2

Instellingen.php

[COLOR= #0000BB]<?php[/COLOR] logincheck[COLOR= #007700]();[/COLOR] 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]zend[/COLOR][COLOR= #007700]])){[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE leden
    SET naam = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]"
    WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass_oud[/COLOR][COLOR= #007700]])){[/COLOR]
        [COLOR= #0000BB]$uFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]));[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700]->[/COLOR]wachtwoord [COLOR= #007700]==[/COLOR] [URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass_old[/COLOR][COLOR= #007700]])){[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass_new1[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass_new2[/COLOR][COLOR= #007700]]){[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass_new1[/COLOR][COLOR= #007700]])){[/COLOR]
                    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE leden SET wachtwoord = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass_new1[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="succes">Uw wachtwoord is veranderd!</div>[/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]<div class="error">Uw nieuwe wachtwoord kan niet leeg zijn!</div>[/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]<div class="error">Uw twee wachtwoorden komen niet overeen!</div>[/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]<div class="error">Het oude wachtwoord is verkeerd!</div>[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]open[/COLOR][COLOR= #007700]])[/COLOR] AND [COLOR= #007700]![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]open[/COLOR][COLOR= #007700]])){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE websites SET aan = 1 WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE websites SET aan = 0 WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR]

    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gb_open[/COLOR][COLOR= #007700]])[/COLOR] AND [COLOR= #007700]![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gb_open[/COLOR][COLOR= #007700]])){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE websites SET gb_open = 1 WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE websites SET gb_open = 0 WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gb_controle[/COLOR][COLOR= #007700]])[/COLOR] AND [COLOR= #007700]![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gb_controle[/COLOR][COLOR= #007700]])){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE websites SET gb_controle = 1 WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE websites SET gb_controle = 0 WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
    }[/COLOR]
    
    [COLOR= #0000BB]$webs[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM websites WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]));
}[/COLOR]
[COLOR= #0000BB]$webs[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM websites WHERE uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]));[/COLOR]
?>
<form method="post" action="">
<fieldset class="page">
    <legend><img src="img/icons/user_edit.png" /> Account instellingen</legend>

    <fieldset>
        <legend><img src="img/icons/vcard_edit.png" /> Websitenaam</legend>
        <input type="text" name="naam"  value="<?= $lid->naam ?>"/>
        Opgelet, hiermee word ook de naam waarmee je inlogd veranderd!<br />
        Je vorige naam zal terug beschikbaar worden voor andere leden.<br />
        Alle bezoekers die deze url kennen zullen nu op iemand anders website terechtkomen. <br />
        <b>Denk hier heel goed over na!</b>
    </fieldset>
    <fieldset>
        <legend><img src="img/icons/link_edit.png" /> Wachtwoord</legend>
        Oud wachtwoord<br />
        <input type="password" name="pass_oud" value="" /> <b>Laat leeg om niet te veranderen!</b><br />
        Nieuw wachtwoord<br />
        <input type="password" name="pass_new1"/><br />
        Herhaal nieuw wachtwoord <small>Iedereen maakt wel eens typfouten...</small><br />
        <input type="password" name="pass_new2"/><br />
        Met dit wachtwoord log je in. Laat deze velden leeg om niets aan te passen.
    </fieldset>
</fieldset>
<fieldset class="page">
    <legend><img src="img/icons/world_edit.png" /> Website instellingen</legend>
    <fieldset>
        <legend><img src="img/icons/door_open.png" /> Open</legend>
        <input type="checkbox" name="open" value="ja" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$webs[/COLOR][COLOR= #007700]->[/COLOR]aan [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"checked"[/COLOR][COLOR= #007700];}[/COLOR] ?> /> Open mijn website voor het grote publiek.<br />
        Je kan je website altijd even terug sluiten voor grote werken, enkel jij kan je website bezoeken als deze gesloten is.
    </fieldset>
    <fieldset>
        <legend><img src="img/icons/image.png" /> Logo</legend>
        Wilt u een logo in plaats van een titel? <a href="?p=logo">Verander uw logo</a>
    </fieldset>
</fieldset>
<fieldset class="page">
    <legend><img src="img/icons/comment.png" /> Gastenboek instellingen</legend>
    <fieldset>
        <legend><img src="img/icons/book_open.png" /> Aan</legend>
        <input type="checkbox" name="gb_open" value="ja" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$webs[/COLOR][COLOR= #007700]->[/COLOR]gb_open [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"checked"[/COLOR][COLOR= #007700];}[/COLOR] ?> /> Maak het gastenboek zichtbaar voor uw bezoekers.<br />
        Je kan je gastenboek altijd openen en sluiten zonder dat er berichten verloren gaan. Berichten verwijderen kan je op <a href="?p=onderdelen/gastenboek">de Gastenboek pagina</a>.
    </fieldset>
    <fieldset>
        <legend><img src="img/icons/bug_error.png" /> Controleren</legend>
        <input type="checkbox" name="gb_controle" value="ja" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$webs[/COLOR][COLOR= #007700]->[/COLOR]gb_controle [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"checked"[/COLOR][COLOR= #007700];}[/COLOR] ?> /> Wilt u de berichten eerst controleren voordat deze gepubliceerd worden? Berichten goed- en afkeuren kan op <a href="?p=onderdelen/gastenboek">de Gastenboek pagina</a>.
    </fieldset>
</fieldset>
<fieldset class="page"> 
    <legend><img src="img/icons/disk.png" /> Opslaan</legend>
    <div id="loading" style="display: none; float: left; padding-right: 10px;"><img src="load.gif" /></div> <div id="form" style="float: left;"><input type="submit" name="zend" value="Opslaan!" onclick="$(#loading).toggle(slow);" /></div>
</fieldset>
</form>


Statistieken.php

<?if(isset($_SESSION[id])){
$page->submenu = 
<fieldset class="menu">
    <legend>Andere data</legend>
    <b>Jaar:</b>  . date("Y") . <br />
    <b>Maand:</b>
    <form method="get" action="">
    <input type="hidden" name="p" value="statistieken" />
    <select name="m" onchange="this.form.submit()">
        <option value="1">Januari</option>
        <option value="2">Februai</option>
        <option value="3">Maart</option>
        <option value="4">April</option>
        <option value="5">Mei</option>
        <option value="6">Juni</option>
        <option value="7">Juli</option>
        <option value="8">Augustus</option>
        <option value="9">September</option>
        <option value="10">Oktober</option>
        <option value="11">November</option>
        <option value="12">December</option>
    </select>
    </form>
</fieldset>
;
?>
<fieldset class="page">
    <legend><img src="img/icons/chart_line.png" /> Statistieken</legend>
    Hieronder vind je een tabel van alle statistieken van deze maand. Hiernaast kan je een andere maand kiezen.<br />
    Dit zijn pageviews.
    <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);
    function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn(string, Datum);
    data.addColumn(number, Views);
    data.addRows([
      [COLOR= #0000BB]<?php[/COLOR]
      [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]m[/COLOR][COLOR= #007700]])){[/COLOR][COLOR= #0000BB]$maand[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]m[/COLOR][COLOR= #007700]]);}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR][COLOR= #0000BB]$maand[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"n"[/COLOR][COLOR= #007700]);}[/COLOR]
      [COLOR= #0000BB]$dQuery[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM stats_simple WHERE MONTH(date) = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$maand[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]" AND uid = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" ORDER BY date;"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dFetch[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dQuery[/COLOR][COLOR= #007700])){[/COLOR]
          [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"["[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$dFetch[/COLOR][COLOR= #007700]->[/COLOR][URL="http://www.php.net/date"]date[/URL] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$dFetch[/COLOR][COLOR= #007700]->[/COLOR]views [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"],"[/COLOR][COLOR= #007700];
      }[/COLOR]
      ?>
    ]);
    
    var options = {
      width: 990, height: 480,
      title: [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]m[/COLOR][COLOR= #007700]])){[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Maand "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]m[/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]"Deze maand"[/COLOR][COLOR= #007700];}[/COLOR] ?>
    };
    
    var chart = new google.visualization.LineChart(document.getElementById(chart_div));
    chart.draw(data, options);
    }
    </script>
    </head>
    <body>
    <div id="chart_div"></div>
    </body>

</fieldset>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
1. wat is regel 105?
2. je gebruikt $page maar $page bestaat niet
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