General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 30th, 2004, 01:11 PM
Pheeal Pheeal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 7 Pheeal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 2 sec
Reputation Power: 0
Question Help! outputting array contents in text file

Hi!,
I'm having a problem using a text file as a flat db to store music details in.
I have each album's details stored on a seperate line with the fields (ID, artist, album title, genre, record label, year and rating) seperated by only a # symbol. I've managed to add albums (one at a time) using fopen (...."a"), I can list them in a HTML table and even search by specific criteria Eg title, artist, id, genre etc, using a complex (for a noob like me) array / explode / strstr / strpos etc. and then listing the matches in a HTML table again.

Now for the part which has me... Deleting:

I am reading the details from the text file and storing them in an array, where I explode("#") them into another array (2D still) so they are stored from first album to last with each new field as a new element in the array (Probably wrong way to do it but worked with my "List albums" page).

In the HTML table beside each album in the table there is a checkbox so they can be "marked for delete", and when the submit button is clicked it runs an if statement:-

if (isset($_POST['godel']) && ('deleteproc' == $_POST['godel']))
__________________________________________________ ______________
//Please see attached code. My boss told me to use Input type= "hidden"//
__________________________________________________ _____________
Then with the "deleted" albums unset from the array I basically I want to copy all array elements that !="" to a new array and then write them to a text file "Music.mus".

I've tried for ages and I can mark the albums "to delete", click "delete(submit button)", but then it doesn't seem to alter my text file, it stays the same as before! Please help, and many apologies for the long POST

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Help! outputting array contents in text file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT