Error

Gestart doorAugust6 reacties51 weergaven

7 berichten · pagina 1 van 1

August

Lid · Topicstarter

Berichten
7.179
Reputatie
1
Punten
3,01
Lid sinds
Laatst gezien
Ik krijg in de volgende code:

[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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]admin[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuwsreporter[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]moderator[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]])) {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"blogs"[/COLOR] [COLOR= #007700]&&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]s[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nid[/COLOR][COLOR= #007700]])) {[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]s[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"verwijderen"[/COLOR][COLOR= #007700]) {[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$blogs[/COLOR][COLOR= #007700]->[/COLOR]blogsVerwijderen[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nid[/COLOR][COLOR= #007700]]);
            }
        }
    }[/COLOR]
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM blogs_berichten ORDER BY blogs_id ASC"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<table cellpadding=0 cellspacing=0 width="700">
            <tr>
                <td style=border-bottom: 1px solid #000000;><strong>#</strong></td>
                <td style=border-bottom: 1px solid #000000;><strong>Titel</strong></td>
                <td style=border-bottom: 1px solid #000000;><strong>Bericht</strong></td>
                <td style=border-bottom: 1px solid #000000;><strong>Actief</strong></td>
                <td style=border-bottom: 1px solid #000000;><strong>verwijderen</strong></td>
            </tr>"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<tr>
                <td>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]blogs_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</td>
                <td>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</td>
                <td>"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]15[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]"</td>
                <td>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]actief[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</td>
                <td><a href=?p=admin_blogs&a=blogs&s=verwijderen&nid="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]blogs_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" onclick=return confirmAction()>Verwijderen</a></td>
            </tr>"[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</table>"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er zijn geen blogs gevonden.<br><a href=javascript:history.go(-1)>Ga terug</a>"[/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]"Zou wel leuk zijn als je admin was.<br /><a href=# onclick=history.go(-1)>Ga terug</a>"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


De volgende error:

Fatal error: Call to a member function blogsVerwijderen() on a non-object in /home/habbohype/domains/habbohype.nl/public_html/habbohype/admin/admin_blogs.php on line 18


Wat doe ik fout?

Groetjes August.
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
De functie blogsVerwijderen(); bestaat niet.
0
August

Lid · Topicstarter

Berichten
7.179
Reputatie
1
Punten
3,01
Lid sinds
Laatst gezien
En hoe voeg ik die dan toe?
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Dan moet je die functie zelf maken.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Nah de functie bestaat misschien wel, maar $blogs is geen object. Dus mag je er geen functies op uitvoeren. Moet je eerst NEW {classnaam} doen.

Daarom vind ik static classes ook best fijn werken yummie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
doe bovenin is $blogs = new NAAM;
(zoals rik het dus uitlegt en NAAM vervangen door je class naam)
0
August

Lid · Topicstarter

Berichten
7.179
Reputatie
1
Punten
3,01
Lid sinds
Laatst gezien
Pff, ik verwijder t wel via de database emo
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