Toon posts:

[PHP] Teveel lege tabelkolommen bij uitslagen rip KNVB

Pagina: 1
Acties:
  • 55 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb onderstaand script van Tom Bode aangepast voor de uitslagen. Maar als ik dit start krijg ik twee helemaal lege <tr>-rijen en om de vier rijen twee lege <td>'s, die daar niet horen te zijn.
Het script:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<? 
/* 
    LATEN STAAN!!!! 
    versie: 1.2 
    Wat: Rip functie om de standenlijst van de knvb af te rippen. 
    Door: Tom Bodde
*/ 



// INSTELLINGEN... 
$checkname = "TOGB B1"; 
$color = "#FFFFCC"; 
$url = "http://comp.knvb.nl/comp/wclub.sps?clubid=BBDY967&clubName=TOGB%2C+BERKEL+EN+RODENRIJS&teamtype1=JUN%2C&teamtype2=VE&teamtype3=1&teamName=0232+B-Junioren%2C+B1&teamno=23&aand=0232&klasse=12&klassename=2e+klasse&poule=D&dist=West2&period=0&results=1&cPage=6&wizPath=345"; 



// GEPROGRAMMEEEEEEEER..... 
$file = fopen("$url","r"); 
$test=FALSE; 
if (!$file) { 
     echo "<p>Sorry. pagina kon niet worden geladen.\n"; 
     exit; 
} 
$x=0; 
$y=0; 
 print("<table border=1 cellspacing=0 cellpadding=0 bordercolor=#000000>"); 
 print("<tr bgcolor=#000000><td><font color=#FFFFFF>Datum</font></td>
    <td><font color=#FFFFFF>Thuis</font></td><td><font color=#FFFFFF>Uit</font></td><td><font color=#FFFFFF>Uitslag</font></td></tr>"); 
 while (!feof($file)) { 
        $line = fgets($file, 2048); 
        
       
       
        if (eregi("\"Uitslagen",$line)) {
        $test = TRUE; 
        $i=0;
    } 
        if (eregi("[img]\"/pix/comp/w_results_table_19.gif\"[/img]",$line)) {
        $test = FALSE;
    } 

               
        if ($test == TRUE){ 
            $line = strip_tags($line); 
            $line = stripslashes($line); 
            $lengte = strlen($line); 
            if($lengte > 4) { 
               $line= ltrim($line); 
               $line= rtrim($line); 
               switch($x) { 
                      case 0: $datum = $line; 
                              break; 
                      case 1: $thuis = $line; 
                              break; 
                      case 2: $uit = $line; 
                              break;
                      case 3: $uitslag = $line;
                              if($thuis == "$checkname" || $uit =="$checkname") { 
                                 print("<tr bgcolor=$color>"); 
                                 print("<td>$datum</td><td>$thuis</td><td>$uit</td><td>$uitslag</td>"); 
                                 print("</tr>"); 
                              } else { 
                                 print("<tr bgcolor=#F8e500>"); 
                                 print("<td>$datum</td><td>$thuis</td><td>$uit</td><td>$uitslag</td>"); 
                                 print("</tr>");
                              } 

                              break; 
               } 
               $x++; 
               if ($x == 4) { $y++; $x=0; } 
            } 
        } 
  
} 

fclose($file); 
print("</table>") 
?> 


Ik zie de fout niet!

[ Voor 14% gewijzigd door Verwijderd op 19-09-2003 19:47 ]


  • Glimi
  • Registratie: Augustus 2000
  • Niet online

Glimi

Designer Drugs

(overleden)
Ten eerste willen wij niet meewerken aan dit soort scripts. De informatie is © KNVB dus het is infeite illegaal om die informatie te rippen zonder hun toestemming
Verder gaat het hier om een 'debug dit even' script. Geef eens aan wat je geprobeerd hebt de volgende keer, ga debuggen of je <td> inputs wel waardes hebben, waarneer het fout gaat enz enz.

Succes ermee :)

Dit topic is gesloten.