habbo topstory systeem

Gestart doorOne2xs15 reacties31 weergaven

16 berichten · pagina 1 van 2

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik heb een habbo topstory systeem en hij haalt de gegevens nu uit een bestand (tekst.php) maar ik wil dat hij het uit database haalt

kan iemand me helpen?
als je wilt helpen graag een pb sturen met je msn of voeg mij toe

~ niels

PS: de code van tekst.php:

var fadeimages=new Array()
fadeimages[0]=["images/topstorys/TS_SUMMER_Surf.gif", "<div class=kop>welkom op mijn site</div><br /> <div class=tussentext>dit is gewoon een simpele test</div>", "meer.php"]
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
var fadeimages=new Array()
[COLOR= #0000BB]<?php
$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT image, kop, text FROM topstorys ORDER BY id LIMIT 0, 3"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])
{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]fadeimages[]=["images/topstorys/[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]]  .[/COLOR] [COLOR= #DD0000]", "<div class="kop">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kop[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div><br /> <div class="tussentext">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div>", "meer.php"][/COLOR][COLOR= #007700];
}[/COLOR]
?>


Zoiets, natuurlijk zelf wel zelf tabellen verandeen wink
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik had gedacht dat het groter zou zijn yummiemaar wisselt hij nu wel om?
want
fadeimages[0]=["images/topstorys/TS_SUMMER_Surf.gif", "<div class=kop>welkom op mijn site</div><br /> <div class=tussentext>dit is gewoon een simpele test</div>", "meer.php"]


kan ook:

fadeimages[0]=["images/topstorys/TS_SUMMER_Surf.gif", "<div class=kop>welkom op mijn site</div><br /> <div class=tussentext>dit is gewoon een simpele test</div>", "meer.php"]
fadeimages[1]=["images/topstorys/TS_SUMMER_Surf.gif", "<div class=kop>welkom op mijn site</div><br /> <div class=tussentext>dit is gewoon een simpele test</div>", "meer.php"]
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Volgens mij als ik me niet vergis werkt het in javascript het zelfde als in PHP, en vult hij het cijfer zelf aan als je een leeg ding doe, wat ik dus gedaan heb:

fadeimages[]=

Moet je dus even uittesten, zoniet, dan kan ik een kleine aanpassing doen ^^
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
nu heeft erik geholpen me mysql verbinding enzo krijg ik dit:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user niels@localhost (using password: YES) in D:xampphtdocstopstoryindex.php on line 2
Access denied for user niels@localhost (using password: YES)

terwijl ik de gegevens goed heb in gevuld
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
code?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
var fadeimages=new Array()
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]localhost[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]niels[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]topstory[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT image, kop, text FROM topstorys ORDER BY id LIMIT 0, 3"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])
{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]fadeimages[]=["images/topstorys/[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]]  .[/COLOR] [COLOR= #DD0000]", "<div class="kop">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kop[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div><br /> <div class="tussentext">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div>", "meer.php"][/COLOR][COLOR= #007700];
}[/COLOR]
?>


PS: wachtwoord is ook het wachtwoord wink
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
var fadeimages=new Array()
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]localhost[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]niels[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]topstory[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT image, kop, text FROM topstorys ORDER BY id LIMIT 0, 3"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]))
{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]fadeimages[]=["images/topstorys/[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]]  .[/COLOR] [COLOR= #DD0000]", "<div class="kop">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kop[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div><br /> <div class="tussentext">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div>", "meer.php"][/COLOR][COLOR= #007700];
}[/COLOR]
?>


Staat trouwens je mysql aan in het xampp control panel??
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ja die staat aan hoe kan ik er anders op zitten
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
nu krijg ik nog steeds error

PS: sorry voor dubbelpost

EDIT: kom ik er achter dat ik in index.php iets verkeert heb gedaan yummie
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
werkt niet
de verbinding en alles iis nu goed maar hij pakt hem niet
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
hij is blanko
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
var fadeimages=new Array()
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]localhost[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]niels[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]topstory[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT image, kop, text FROM topstorys ORDER BY id LIMIT 0, 3"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])) {[/COLOR]
    [COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]=[/COLOR]  [COLOR= #DD0000]=["images/topstorys/[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]]  .[/COLOR] [COLOR= #DD0000]", "<div class="kop">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kop[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div><br /> <div class="tussentext">[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]</div>", "meer.php"][/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/for"]for[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]fadeimages[[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]][/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$a[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Geen idee of ie zo werkt lol
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
ik denk dat ik iets verkeert he gedaan:
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Nielsie, er bestaat ook een functie om je post te bewerken, zo kun je een triplepost voorkomen...
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