FalseHope
Active Member
- Messages
- 1,639
- Reaction score
- 0
- Points
- 36
I am trying to get the name of the person in the text file in one column and their total in another column. How do I do it? this is my code:
[/B]
This is what it looks like:
http://www.gummiebear.x10hosting.com/template/ttbc.php
I want to split the name and number and put them in their own column.
Code:
[B]<?php
[U]function[/U] getline($file,$line)
{
$fd = fopen($file, "r");
$liner = 0;
[U]while[/U] ($txt=fgets($fd)) {
$liner++;
[U]if[/U] ($liner == $line) {
$textl = $txt;
}
}
fclose ($fd);
[U]return[/U] $textl;
}
[U]echo[/U] '[B]<table width="300" border="3">[/B][B]<tr>[/B][B]<td>[/B]1[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',1).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]2[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',2).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]3[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',3).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]4[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',4).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]5[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',5).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]6[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',6).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]7[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',7).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]8[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',8).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]9[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',9).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]10[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',10).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]11[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',11).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]12[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',12).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]13[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',13).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]14[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',14).'[B]</td>[/B][B]</tr>[/B]';
[U]echo[/U] '[B]<tr>[/B][B]<td>[/B]15[B]</td>[/B][B]<td align="center">[/B]'.getline('ttbc2.txt',15).'[B]</td>[/B][B]</tr>[/B][B]</table>[/B]';
?>
This is what it looks like:
http://www.gummiebear.x10hosting.com/template/ttbc.php
I want to split the name and number and put them in their own column.
Last edited: