mentor come here boy *whistles*

*Gets frizbe and throws*
Ok your all super spaming and being stupid "? I have looked through other files but I cant seem to find a way of doing it if you dont know then dont answer dont just start spamming.
Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
[Thybag.co.uk - Vive la revolutione]
Sorry
Umm
If the news goes to news.txt and that updates, shouldnt show_news.php point to news.txt
yes but cutenews is very different it contains lots of templates and other files so its not clear where it is "/
Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
[Thybag.co.uk - Vive la revolutione]
Ok, so you mean link editing a line in a flat file, or displaying the data from the flat file?Originally Posted by splintercell!
Ok do you know how to remove info from a flat file and display it on a webpage (like cutenews).
for dispay most important things is the
file();
command, wich splits the lines and turns them in to an array.
Say to get flat file bob.txt
$arrayvariable = file("bob.txt");
Then split the varible down again
depedning on what your useing a seportaors (cute news use's |/\| i usealy use || thogh
foreach($arrayvariable as $Key => $Val)
{
//explode that data into a array
$info[$Key] = explode(",", $Val);
}
now the $info varible contains both arrays, wich you can output via a loop
for($num = 0; $num<sizeof($arrayvariable) + 1; $num++)
{
echo $info[$num][0];
}
This would dispaly the the first entry of everu line, since its changing the arry var while looping threw them all.
to show second bit $info[$num][1];
etc etc etc
if you follow?
the flat file struture in the exsample would be
user1||stuff||morestuff||
user2||stuff2||morestuff2|
etc etc
*gives mentor a gold star* ThanksHelped me alot none of the php sites seems to have it, Ive done it in mySQL before but I wanted to use a flat file to see how it works
Thanks.!
Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
[Thybag.co.uk - Vive la revolutione]
Want to hide these adverts? Register an account for free!