login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Id selecteren?

Offline tomk - 12/07/2005 09:49
Avatar van tomkASP interesse Beste mensen,

Ik heb een vraag. Kijk ik heb dit: http://www.carriere-manager.nl/top15.php . Als je dan op een team klikt moet hij info van dat team weergeven. MAar hij geeft dan van alle team weer. dit zijn de scripts:

top15.php
  1. <?
  2. include("functies.php");
  3.  
  4. $var = "iedereen";
  5. $toegang = beveiliging($var);
  6. $ban = ban();
  7.  
  8. if(!$toegang == 0) {
  9. if(!$ban == 1) {
  10. ?>
  11. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  15. <title>Carriere-Manager :: Top 15</title>
  16. </head>
  17.  
  18. <body>
  19. <font size="2"><strong>Top 15 teams</strong></font>
  20. <table width="336" cellspacing="0" cellpadding="0">
  21. <tr>
  22. <td width="36"><font size="2"><strong>Land</strong></font></td>
  23. <td width="133"><font size="2"><strong>Naam</strong></font></td>
  24. <td width="100"><font size="2"><strong>Punten
  25. <?
  26. $tp_sql = "SELECT id, clubnaam, punten, land FROM leden ORDER BY punten DESC LIMIT 15";
  27. $tp_res = mysql_query($tp_sql);
  28.  
  29. while($tp = mysql_fetch_assoc($tp_res)) {
  30. ?>
  31. </strong></font></td>
  32. <td width="65"><font size="2"><strong> </strong></font></td>
  33. </tr>
  34. </table>
  35. <table width="334" height="18" cellpadding="0" cellspacing="0">
  36. <tr>
  37. <td width="36"><strong><font size="2"><strong><img src="<? echo $tp['land']; ?>" alt="image" name="button" width="18" height="12" /></strong></font>
  38. </strong></td>
  39. <td width="132"><font size="2"><strong><a href="team.php?teamnr=<? echo $tp['id']; ?>"><? echo $tp['clubnaam']; ?></strong></font></td>
  40. <td width="99"><font size="2"><strong><? echo $tp['punten']; ?>
  41. <?
  42. }
  43. ?>
  44. </strong></font></td>
  45. <td width="65"><font size="2"><strong> </strong></font></td>
  46. </tr>
  47. </table>
  48. <p>&nbsp; </p>
  49. <p>&nbsp;</p><p>&nbsp;</p></body>
  50. </html>
  51. <?
  52. } else {
  53. $sql = "SELECT * FROM ban WHERE ip='".$_SERVER['REMOTE_ADDR']."'";
  54. $res = mysql_query($sql);
  55. $fet = mysql_fetch_assoc($res);
  56. $mes = $fet['mes'];
  57. echo $mes;
  58. }
  59. } else {
  60. echo "U bent niet bevoegd om deze pagina te bekijken";
  61. }
  62. ?>


team.php:
  1. <?
  2. include("functies.php");
  3.  
  4. $var = "iedereen";
  5. $toegang = beveiliging($var);
  6. $ban = ban();
  7.  
  8. if(!$toegang == 0) {
  9. if(!$ban == 1) {
  10. ?>
  11. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  15. <title>Carriere-Manager :: Team <? echo $tp['clubnaam']; ?></title>
  16. </head>
  17.  
  18. <body>
  19. <p><font size="2"><strong>
  20. <?
  21. $tp_sql = "SELECT id, clubnaam, land FROM leden";
  22. $tp_res = mysql_query($tp_sql);
  23.  
  24. while($tp = mysql_fetch_assoc($tp_res)) {
  25. ?>
  26. </strong></font></p>
  27. <table width="329" height="70" cellpadding="0" cellspacing="0">
  28. <tr>
  29. <td width="43"><strong><font size="2"> Team:</font></strong></td>
  30. <td width="24"><strong><font size="2"><strong><img src="<? echo $tp['land']; ?>" alt="image" name="button" width="18" height="12" />
  31. </strong></font></strong></td>
  32. <td width="175"><strong><? echo $tp['clubnaam']; ?></strong></td>
  33. <td width="85">&nbsp;</td>
  34. </tr>
  35. <tr>
  36. <td>&nbsp;</td>
  37. <td>&nbsp;</td>
  38. <td>&nbsp;</td>
  39. <td>&nbsp;</td>
  40. </tr>
  41. <tr>
  42. <td><strong><font size="2">Spelers:</font></strong></td>
  43. <td>&nbsp;</td>
  44. <td><font size="2"><strong>Dit team heeft nog geen spelers
  45. <?
  46. }
  47. ?>
  48. </strong></font></td>
  49. <td>&nbsp;</td>
  50. </tr>
  51. </table>
  52. <p>&nbsp;</p>
  53. <p>&nbsp;</p></body>
  54. </html>
  55. <?
  56. } else {
  57. $sql = "SELECT * FROM ban WHERE ip='".$_SERVER['REMOTE_ADDR']."'";
  58. $res = mysql_query($sql);
  59. $fet = mysql_fetch_assoc($res);
  60. $mes = $fet['mes'];
  61. echo $mes;
  62. }
  63. } else {
  64. echo "U bent niet bevoegd om deze pagina te bekijken";
  65. }
  66. ?>


Bedankt voor de hulp:cool:

5 antwoorden

Gesponsorde links
Offline MechaVore - 12/07/2005 10:06 (laatste wijziging 12/07/2005 10:07)
Avatar van MechaVore Gouden medaille

PHP gevorderde
  1. <?
  2. $tp_sql = "SELECT id, clubnaam, land FROM leden WHERE id='".(is_numeric($_GET['teamnr'])) ? $_GET['teamnr'] : ""."'";
  3. ?>
Offline tomk - 12/07/2005 10:10
Avatar van tomk ASP interesse Nu krijg ik een error:'( . Deze error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/carriere-manager.nl/www/team.php on line 27


Hier script met dat erin:
  1. <?
  2. include("functies.php");
  3.  
  4. $var = "iedereen";
  5. $toegang = beveiliging($var);
  6. $ban = ban();
  7.  
  8. if(!$toegang == 0) {
  9. if(!$ban == 1) {
  10. ?>
  11. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  15. <title>Carriere-Manager :: Team <? echo $tp['clubnaam']; ?></title>
  16. </head>
  17.  
  18. <body>
  19. <p><font size="2"><strong>
  20. <?
  21. $tp_sql = "SELECT id, clubnaam, land FROM leden WHERE
  22. id='".(is_numeric($_GET['teamnr'])) ? $_GET['teamnr'] : ""."'";
  23. $tp_res = mysql_query($tp_sql);
  24. while($tp = mysql_fetch_assoc($tp_res)) {
  25. ?>
  26. </strong></font></p>
  27. <table width="329" height="70" cellpadding="0" cellspacing="0">
  28. <tr>
  29. <td width="43"><strong><font size="2"> Team:</font></strong></td>
  30. <td width="24"><strong><font size="2"><strong><img src="<? echo $tp['land']; ?>" alt="image" name="button" width="18" height="12" />
  31. </strong></font></strong></td>
  32. <td width="175"><strong><? echo $tp['clubnaam']; ?></strong></td>
  33. <td width="85">&nbsp;</td>
  34. </tr>
  35. <tr>
  36. <td>&nbsp;</td>
  37. <td>&nbsp;</td>
  38. <td>&nbsp;</td>
  39. <td>&nbsp;</td>
  40. </tr>
  41. <tr>
  42. <td><strong><font size="2">Spelers:</font></strong></td>
  43. <td>&nbsp;</td>
  44. <td><font size="2"><strong>Dit team heeft nog geen spelers
  45. <?
  46. }
  47. ?>
  48. </strong></font></td>
  49. <td>&nbsp;</td>
  50. </tr>
  51. </table>
  52. <p>&nbsp;</p>
  53. <p>&nbsp;</p></body>
  54. </html>
  55. <?
  56. } else {
  57. $sql = "SELECT * FROM ban WHERE ip='".$_SERVER['REMOTE_ADDR']."'";
  58. $res = mysql_query($sql);
  59. $fet = mysql_fetch_assoc($res);
  60. $mes = $fet['mes'];
  61. echo $mes;
  62. }
  63. } else {
  64. echo "U bent niet bevoegd om deze pagina te bekijken";
  65. }
  66. ?>
Offline MechaVore - 12/07/2005 10:12
Avatar van MechaVore Gouden medaille

PHP gevorderde
  1. <?
  2. $tp_sql = "SELECT id, clubnaam, land FROM leden WHERE
  3. id='".$_GET['teamnr']."'";
  4. ?>

Dit moet je nog wel beveiligen, maar probeer het zo is.
Offline tomk - 12/07/2005 10:16
Avatar van tomk ASP interesse Bedankt^^ Nu werkt hij wel:D. Echt bedankt(#kusje)
Offline MechaVore - 12/07/2005 10:18
Avatar van MechaVore Gouden medaille

PHP gevorderde
graag gedaan, maar ik zal het toch ff beveiligen, zet gewoon ff if(is_numeric($_GET['teamnr'])){
erbij
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.213s