phpBB2.de Forum Index  
[netclusive - internet broadcasting]
 FAQ  •  Search  •  Download  •  Bookmarks  •  Memberlist  •  Usergroups   •  Register  •  Profile  •  Log in to check your private messages  •  Log in
 
        
 
        
 

LinkLift

View next topic
View previous topic

This forum is locked: you cannot post, reply to, or edit topics.This topic is locked: you cannot edit posts or make replies.
Author Message
gomamon
phpBB2.de User
phpBB2.de User



Joined: 18 Oct 2002
Posts: 8

PostPosted: Wed 04 Dec, 2002 19:15 Reply with quoteBack to top 

hallo,
ich möchte daten einlesen/schreiben mit php in eine text datei,
die text datei soll so aufgebaut sein:

1
Name:irgendeiner
Datum:12.12.02 (zb)
Art:Artbook
preis:6 euro (Zb)

2
Name:wasauchimmer
Datum:11.10.08 (zb)
Art:buch
preis:7 euro (Zb)

Wenn ich die datein einlesen möchte soll er mir jeden punkt in eine neue spalte einer tabelle packen
also:

1 = Spalte 1
2 = spalte 2

das ganze soll ohne db laufen

danke für eure hilfe im voraus
OfflineView user's profileSend private messageVisit poster's website
Google







Posted: Back to top

Novan
phpBB2.de User
phpBB2.de User



Joined: 10 Aug 2002
Posts: 112
Location: Münster

PostPosted: Wed 11 Dec, 2002 21:26 Reply with quoteBack to top 

Hi,
ich kann dir nur ansatzweise sagen wie es geht. Für mehr reicht die Zeit leider nicht.
Also:
Erstmal legste dir ne Datei an die als speicher dienen soll.
und dann :
Code:


Schreiben : (wenn die Datei nicht exestiert wird sie automatisch angelegt)
$file = fopen ("dateiname.xxx", "a");
fputs ( $file , "$name\n $datum\n $art\n $preis\n");
fclose ($file);

Lesen :
$file = fopen ("dateiname.xxx", "r");
$daten = array(array());
$i = 0;
$j = 0;
while (!eof($file))
{
         $zeile = fgets($file, 1024);
         $zeile = split("[:]", $zeile);
         switch ($zeile[0])
         {
               case "Name" : $daten[$i]['name'] = $zeile[1]; break;
               case "Datum" : $daten[$i]['datum'] = $zeile[1]; break;
               case "Art" : $daten[$i]['art'] = $zeile[1]; break;
               case "preis" : $daten[$i]['preis'] = $zeile[1]; break;
         }
         $j++;
         if ($j==4)
         {
             $i++;
             $j=0;
          }
}
fclose($file);
foreach ($daten as $temp)
{
       $temp['name'] ----> feld name
       $temp['datum'] ----> feld datum
       $temp['art'] ----> feld art
       $temp['preis'] ----> feld preis
}


Wenn du jetzt noch Seitenzahlen reinmachen willst in die ausgabe, dann mußte leider selber grübeln aber so schwer isses nicht.
Für Fehler übernehme ich keine Hafftung is nur nen ansatz weitergehendes mußte selber machen Wink
}

_________________
mfg
Novan
Image
Zum Ultimativen "Moppet" Portal
OfflineView user's profileSend private messageSend e-mailVisit poster's website
Display posts from previous:      
This forum is locked: you cannot post, reply to, or edit topics.This topic is locked: you cannot edit posts or make replies.

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Similar Topics
Topic Author Forum Replies Posted
Html aktivieren, ich noob -.- Hunter Support allgemein 1 Tue 05 May, 2009 06:57 View latest post
Text in der Bestätigungsemail ändern PitPossum Plus 1.53 Beta Support 1 Fri 10 Apr, 2009 09:22 View latest post
Adminbereich Anzeige nur Text und Li... andreasf Support allgemein 2 Sun 08 Mar, 2009 19:42 View latest post
HTML wird nicht angezeigt! MasterNick phpBB2.x - Support 3 Tue 12 Aug, 2008 17:38 View latest post
How can I change the text color on Ch... Count Karnstein phpBB2.x - English phpBB2.x Talk 5 Fri 04 Jul, 2008 00:26 View latest post