login  Naam:   Wachtwoord: 
Registreer je!
 Forum

poll bar verwijderen

Offline baracus - 27/02/2005 14:28 (laatste wijziging 27/02/2005 14:29)
Avatar van baracusNieuw lid
  1. <?
  2. include ("poll.txt");
  3.  
  4. if ($stem) {
  5.  
  6. $ip = fopen("ip.php", "r");
  7. $contents = fread($ip, filesize("ip.php"));
  8. $uip = $REMOTE_ADDR;
  9.  
  10. if (eregi("$uip", $contents)) {
  11. echo "<font face=verdana size=2><b>Je hebt al gestemd! Bij de volgende poll mag je weer meedoen.</b></font><br><br>";
  12. }
  13. else {
  14.  
  15. $ip = fopen("ip.php", "a");
  16. fputs ($ip, "<? //$REMOTE_ADDR ?>\n");
  17. fclose ($ip);
  18.  
  19. $file = fopen("poll.txt", "w+");
  20.  
  21. fputs ($file, "<?\n");
  22. fputs ($file, "\$antwoord[0] = \"$antwoord[0]\";\n");
  23. fputs ($file, "\$antwoord[1] = \"$antwoord[1]\";\n");
  24. fputs ($file, "\$antwoord[2] = \"$antwoord[2]\";\n");
  25. fputs ($file, "\$antwoord[3] = \"$antwoord[3]\";\n");
  26. fputs ($file, "\$antwoord[4] = \"$antwoord[4]\";\n");
  27. fputs ($file, "\$antwoord[5] = \"$antwoord[5]\";\n");
  28. fputs ($file, "\$antwoord[6] = \"$antwoord[6]\";\n");
  29. fputs ($file, "\$antwoord[7] = \"$antwoord[7]\";\n");
  30. fputs ($file, "\$antwoord[8] = \"$antwoord[8]\";\n");
  31. fputs ($file, "\$antwoord[9] = \"$antwoord[9]\";\n\n");
  32.  
  33. if ($stem == $antwoord[0]) { $plusone = $votes[0] + 1; fputs ($file, "\$votes[0] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[0] = \"$votes[0]\";\n"); }
  34. if ($stem == $antwoord[1]) { $plusone = $votes[1] + 1; fputs ($file, "\$votes[1] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[1] = \"$votes[1]\";\n"); }
  35. if ($stem == $antwoord[2]) { $plusone = $votes[2] + 1; fputs ($file, "\$votes[2] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[2] = \"$votes[2]\";\n"); }
  36. if ($stem == $antwoord[3]) { $plusone = $votes[3] + 1; fputs ($file, "\$votes[3] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[3] = \"$votes[3]\";\n"); }
  37. if ($stem == $antwoord[4]) { $plusone = $votes[4] + 1; fputs ($file, "\$votes[4] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[4] = \"$votes[4]\";\n"); }
  38. if ($stem == $antwoord[5]) { $plusone = $votes[5] + 1; fputs ($file, "\$votes[5] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[5] = \"$votes[5]\";\n"); }
  39. if ($stem == $antwoord[6]) { $plusone = $votes[6] + 1; fputs ($file, "\$votes[6] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[6] = \"$votes[6]\";\n"); }
  40. if ($stem == $antwoord[7]) { $plusone = $votes[7] + 1; fputs ($file, "\$votes[7] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[7] = \"$votes[7]\";\n"); }
  41. if ($stem == $antwoord[8]) { $plusone = $votes[8] + 1; fputs ($file, "\$votes[8] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[8] = \"$votes[8]\";\n"); }
  42. if ($stem == $antwoord[9]) { $plusone = $votes[9] + 1; fputs ($file, "\$votes[9] = \"$plusone\";\n"); } else { fputs ($file, "\$votes[9] = \"$votes[9]\";\n"); }
  43.  
  44. $plusone = $totaal + 1;
  45. fputs ($file, "\$totaal = \"$plusone\";\n");
  46. fputs ($file, "\$vraag = \"$vraag\";\n");
  47. fputs ($file, "?>");
  48.  
  49. fclose ($file);
  50.  
  51. echo "<meta http-equiv=refresh content=\"0; URL=$PHP_SELF";
  52. if ($QUERY_STRING) { echo "?$QUERY_STRING\">"; } else { echo "\">"; }
  53.  
  54. } }
  55.  
  56. if ($vraag == "") { echo "<font face=verdana size=2><b>Er is geen poll open"; }
  57.  
  58. else {
  59.  
  60. $ip = fopen("ip.php", "r");
  61. $contents = fread($ip, filesize("ip.php"));
  62. $uip = $REMOTE_ADDR;
  63.  
  64. if (eregi("$uip", $contents)) {
  65.  
  66. echo "&nbsp;<font face=verdana size=2><b>$vraag</b> <font size=1>$totaal ";
  67.  
  68. if ($totaal == "1") { echo "stem"; } else { echo "stemmen"; }
  69.  
  70. echo " uitgebracht</font>\n\n";
  71. echo "<table cellpadding=0 cellspacing=0 border=0>\n";
  72. echo " <tr>\n";
  73. echo " <td>\n";
  74.  
  75. for ($i = 0; $i < count($antwoord); $i++) {
  76.  
  77. if ($antwoord[$i] == "") { echo ""; } else {
  78.  
  79. echo " &nbsp;<font face=verdana size=1><b>$antwoord[$i]</b><br></font>\n";
  80.  
  81. } }
  82.  
  83. echo " </td>\n";
  84. echo " <td valign=top>\n\n";
  85. echo " <table cellpadding=0 cellspacing=0 border=0>\n";
  86.  
  87. for ($i = 0; $i < count($votes); $i++) {
  88.  
  89. if ($votes[$i] == "") { echo ""; } else {
  90.  
  91. echo " <tr>\n";
  92. echo " <td align=right>\n";
  93. echo " &nbsp;&nbsp;&nbsp;<font face=verdana size=1>";
  94.  
  95. echo (round(($votes[$i] / $totaal) * 100, 1));
  96.  
  97. echo "%</font>\n";
  98. echo " </td>\n";
  99. echo " <td>\n";
  100. echo " &nbsp;<img style=\"border: 1 solid #000000\" src=balk.gif height=7 width=";
  101. echo (round(($votes[$i] / $totaal) * 100, 1));
  102. echo "><font face=verdana size=1> $votes[$i] ";
  103.  
  104. if ($votes[$i] == "1") { echo "stem"; } else { echo "stemmen"; }
  105.  
  106. echo "<br></font>\n";
  107. echo " </td>\n";
  108. echo " </tr>\n";
  109.  
  110. } }
  111.  
  112. echo " </table>\n\n";
  113. echo " </td>\n";
  114. echo " </tr>\n";
  115. echo "</table>\n\n";
  116.  
  117. } else {
  118.  
  119. echo "&nbsp;<font face=verdana size=2><b>$vraag</b><br>\n\n";
  120. echo "<table cellpadding=0 cellspacing=0 border=0>\n";
  121. echo " <form name=form method=post><font face=verdana size=1>\n";
  122.  
  123. for ($i = 0; $i < count($antwoord); $i++) {
  124.  
  125. if ($antwoord[$i] == "") { echo ""; } else {
  126.  
  127. echo " <tr>\n";
  128. echo " <td>\n";
  129. echo " <input type=radio name=stem value=\"$antwoord[$i]\" id=\"$antwoord[$i]\">\n";
  130. echo " </td>\n";
  131. echo " <td>";
  132. echo "<font size=1><label for=\"$antwoord[$i]\">$antwoord[$i]</label></font>";
  133. echo "</td>\n";
  134. echo " </tr>\n";
  135.  
  136. } }
  137.  
  138. echo "</table>\n\n";
  139. echo "<input style=\"font-face: verdana; font-size: 9px\" type=submit value=\" Stem! \">\n";
  140. echo "</form>\n\n";
  141.  
  142. } }
  143. ?>



dit is de code en op lijn 100 staat de bar maar als ik alleen die lijn weg doe krijg ik error, dus welke lijnen moeten er allemaal weg?

2 antwoorden

Gesponsorde links
Offline prorsoft - 30/11/1999 00:00
Avatar van prorsoft PHP gevorderde regel 100,101 en 102rnmaar [b]als het de bedoeling is om regel 102 te laten staan[b], moet je regel 101 veranderen inrn[code]rnecho (round(($votes[$i] $totaal) 100, 1)).; rn[code]rnen regel 102 inrn[code]rnecho font face=verdana size=1 $votes[$i] ;rn[code]
Offline baracus - 30/11/1999 00:00
Avatar van baracus Nieuw lid nu komt er daar z'n 50 tussen te staan oe doe ik dat wegrnrnhier is de url httpwww.theceleblog.compoll1.php
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.239s