php-general | 2000071
Date: 07/12/00
- Next message: Matt Williams: "[PHP] Re: [PHP-DB] Adding an DATETIME as a string to a mySQL databse...."
- Previous message: Boaz Yahav: "[PHP] RE: [PHP-DB] Adding an DATETIME as a string to a mySQL databse... ."
- Next in thread: Jerry: "Re: [PHP] writing to txt-file! if and else!"
- Reply: Jerry: "Re: [PHP] writing to txt-file! if and else!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Need some help!
Hi there I'm currently making a php page that writes to a txt file... I have books and bookloaners in the txt-file!
If the book don't exist i want a <br> and bookno user
like this:
1 55555
elseif it does exist i want to place the user(name) at the end, in que!
Here is my source:
<?
$filnavn = "liste.txt";
$fpr = fopen($filnavn, "r");
while($innhold = fgets($fpr, 4096)) {
$do_explode = explode(" ", $innhold);
if ($do_explode[0] <> $no) {
$count = count($do_explode) - 1;
for ($i = 1; $i <= $count; $i++)
echo "Book already exists ($count in que!)";
\\add to end of line here
}
if ($do_explode[0] == $no) {
$filnavn = "liste.txt";
$fpr = fopen($filnavn, "a+");
\\new entry here
// fclose($fpr);
fwrite ($fpr, "\n$no $empl_nr");
// fclose($fpr)
} }
?>
Best Regards
Fredrik A. Takle
ftakle <email protected>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Matt Williams: "[PHP] Re: [PHP-DB] Adding an DATETIME as a string to a mySQL databse...."
- Previous message: Boaz Yahav: "[PHP] RE: [PHP-DB] Adding an DATETIME as a string to a mySQL databse... ."
- Next in thread: Jerry: "Re: [PHP] writing to txt-file! if and else!"
- Reply: Jerry: "Re: [PHP] writing to txt-file! if and else!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

