PHP help me

Gestart doorJesper177 reacties875 weergaven

178 berichten · pagina 9 van 12

Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Joeyl schreef:
Eerdere citaten tonen
Aarclay schreef:
Ik vraag me af of het niet beter is dat de TS er beter aan doet om dit in de ijskast te schuiven, en te beginnen met een Hello World oefening.
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dat is niet zo aardig om te zeggen..[/COLOR][COLOR= #007700];[/COLOR]
?>

Verklaar je nader?
Ik heb 5 jaar ervaring,. en als ik de gemaakte fouten zo zie, is dit zeker een goede tip om een bij het begin te beginnen.
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwingp[/COLOR][COLOR= #007700]])){[/COLOR]

[COLOR= #FF8000]// COPYRIGHT MANXI
// MADE BY: JESPER[/COLOR]



    
        [COLOR= #0000BB]$uQuerya[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetcheaea[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" ORDER BY id"[/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]$uFetcheae[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuerya[/COLOR][COLOR= #007700]);[/COLOR]

?>
<h2>Waarschuwingen</h2><br>
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetcheae[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]  ?><br>
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetcheae[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwing[/COLOR][COLOR= #007700]];[/COLOR]  ?>
<br><br>


Hoe laat ik username en waarschuwing van iedereen zien en niet eentje?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
While ?
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php

    $mResult[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users"[/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]$uResult[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mResult[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uResult[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/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/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetchx[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700])) {[/COLOR]
?>

<h2>Waarschuwingen</h2><br>
[COLOR= #0000BB]<?php[/COLOR]  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetchx[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR] ?><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetchx[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwing[/COLOR][COLOR= #007700]];[/COLOR] ?><br /><br />

[COLOR= #0000BB]<?php[/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]"Geen Leden gevonden. "[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Hij geeft er nog steeds maar 1 weer
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
WHERE username = " . mysql_real_escape_string($uResult[username]) . "

Komt omdat je daarmee 1 iemand selecteert.
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe los je dat op?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als dat 1 iemand selecteert, wat dacht je van weghalen?
0
Berichten
3.074
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Eerdere citaten tonen
Joeyl schreef:
Eerdere citaten tonen
Aarclay schreef:
Ik vraag me af of het niet beter is dat de TS er beter aan doet om dit in de ijskast te schuiven, en te beginnen met een Hello World oefening.
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dat is niet zo aardig om te zeggen..[/COLOR][COLOR= #007700];[/COLOR]
?>

Verklaar je nader?
Ik heb 5 jaar ervaring,. en als ik de gemaakte fouten zo zie, is dit zeker een goede tip om een bij het begin te beginnen.
Hello World is anders te overdreven.
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwingp[/COLOR][COLOR= #007700]])){[/COLOR]

[COLOR= #FF8000]// COPYRIGHT MANXI
// MADE BY: JESPER[/COLOR]


    [COLOR= #0000BB]$mResult[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users"[/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]$uResult[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mResult[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users"[/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/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetchx[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700])) {[/COLOR]
?>


[COLOR= #0000BB]<?php[/COLOR]  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetchx[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR] ?><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetchx[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwing[/COLOR][COLOR= #007700]];[/COLOR] ?>%<br /><br />

[COLOR= #0000BB]<?php[/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]"Geen Leden gevonden. "[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Dat is opgelost,

Maar hoe doe ik dat er 10 resultaten op 1 pagina komt en dan maakt hij automatisch een nieuwe pagina met 10 aan net zoveel tot hij alle leden heeft geselecteerd?
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dit is niet beveiligd tegen xss injecties he.
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat doe ik altijd als laatst maar
Afbeelding
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jespar schreef:
Dat doe ik altijd als laatst maar
Afbeelding
Zo vergeet je.

Dat andere, daarvoor moet je maar eens googlen op paginaysteem. LIMIT 10, maar als je echt paginas wil das te hoog gegrepen voor jou denk ik. Dit is al 131ste reactie smile
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwingp[/COLOR][COLOR= #007700]])){[/COLOR]

[COLOR= #FF8000]// COPYRIGHT MANXI & ONE2XS
// MADE BY: JESPER & LEDEN VAN ONE2XS[/COLOR]



 [COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]&[/COLOR][COLOR= #007700]] ) ?[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]&[/COLOR][COLOR= #007700]] :[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$aantal_per_pagina[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$start[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]$aantal_per_pagina[/COLOR][COLOR= #007700];[/COLOR]
 
[COLOR= #0000BB]$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users LIMIT $start, $aantal_per_pagina"[/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]$uQuery[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetchx[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700])) {[/COLOR]
?>


[COLOR= #0000BB]<?php[/COLOR]  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetchx[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR] ?><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetchx[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarschuwing[/COLOR][COLOR= #007700]];[/COLOR] ?>%<br /><br />

[COLOR= #0000BB]<?php[/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]"Geen Leden gevonden. "[/COLOR][COLOR= #007700];
}[/COLOR]
?>

<a href="index.php?p=admin&waarschuwingp&[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700])[/COLOR] ?>">Vorige</a><br>
<a href="index.php?p=admin&waarschuwingp&[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700])[/COLOR] ?>">Volgende</a>


Waar ben ik de fout in gegaan?
0
Berichten
10.409
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ten eerste, waarom claim je dat script? Het is niet eens gemaakt door jouw.
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