Aronnn
01-20-2012, 10:40 PM
Hey,
I am attempting to let my users edit a CSV file from their control panel. They all should have 2 "slots". I am using the following format:
"Laur3ns1","world","Laur3ns","190.06752899480915","69.0","1643.384470515287","-32.700108","184.04663"
"Laur3ns2","world","Laur3ns","-1607.703077719658","63.0","1523.51365067294","29.54973","-40.56433"
"Aronnn1","world_nether","Aronnn","-203.0878960285693","64.0","0.49427347759672624","39.3","-175.35004"
What it should do is it should be able to check how many slots you have used, in this case the person Laur3ns used 2 of them and Aronnn only 1. I can develop a panel which allows you to update them both but do not know how to check if they are used and if not add one, and if it is used, update it. The current code I am using to output it is:
<?PHP
$file_handle = fopen("warps.csv", "r");
while (!feof($file_handle) ) {
$line = fgetcsv($file_handle, 1024);
print $line[0] . $line[1] . $line[2] . $line[3] . $line[4] . $line[5] . $line[6] . $line[7] . "<BR>";
}
fclose($file_handle);
?>
If anybody could help me I could highly appreciate it,
Aron
I am attempting to let my users edit a CSV file from their control panel. They all should have 2 "slots". I am using the following format:
"Laur3ns1","world","Laur3ns","190.06752899480915","69.0","1643.384470515287","-32.700108","184.04663"
"Laur3ns2","world","Laur3ns","-1607.703077719658","63.0","1523.51365067294","29.54973","-40.56433"
"Aronnn1","world_nether","Aronnn","-203.0878960285693","64.0","0.49427347759672624","39.3","-175.35004"
What it should do is it should be able to check how many slots you have used, in this case the person Laur3ns used 2 of them and Aronnn only 1. I can develop a panel which allows you to update them both but do not know how to check if they are used and if not add one, and if it is used, update it. The current code I am using to output it is:
<?PHP
$file_handle = fopen("warps.csv", "r");
while (!feof($file_handle) ) {
$line = fgetcsv($file_handle, 1024);
print $line[0] . $line[1] . $line[2] . $line[3] . $line[4] . $line[5] . $line[6] . $line[7] . "<BR>";
}
fclose($file_handle);
?>
If anybody could help me I could highly appreciate it,
Aron