@JonaJan 14.2005 — #[font=trebuchet ms]You can't do it in that order. Do you want a function that opens a file, appends to it, reads it, deletes it, then returns the value before the contents were deleted?[/font]
@JonaJan 15.2005 — #[font=trebuchet ms]Try looking up the filesystem functions at PHP.net. I would just use one function for all of those. Try this function I wrote for my [url=http://www.cmmwebdesign.com/v3/software/chategory]Chategory[/url] software:[/font]
@JonaJan 15.2005 — #[code=php] /*** * Function file_open * Purpose: quick way to write to, delete from, or append to a file * Variables: $file, $type, $value (optional) * Example: file_open(string file to open, string method to open (one of w, w+, r, r+, a, a+, x, x+) [, string value to write to file when using any variation of w, a or x]) ***/ function file_open($file, $type, $value = ""){ # If the file does not exist and you are trying to # append to it, create the file instead of returning # an error. if(!file_exists($file) && $type == "a") {$type = "w";} # Supress any errors and open the file $fh = @fopen($file, $type); # If something is to be written to the file if($value != ""){ # Write to the file @fwrite($fh, $value); } # If the file has not been written to # and is not supposed to be written to if($type != 'w' && $type != 'a'){ # Read and return the contents of the file return @fread($fh, @filesize($file)); } # Close the file; supress errors in the # event that the file was never successfully # opened. @fclose ($fh); } [/code]
[font=trebuchet ms]Some example uses...[/font]
[code=php] // Read contents of a file: echo file_open('myfile.txt', 'r');
// Append to a file; create the file and // write to it if it doesn't already exist
@JonaMar 07.2005 — #[i]Originally posted by emblem [/i]
[B]XML in javascript [/B][/QUOTE]
[font=trebuchet ms]I've done a bit of work with XMLHttpRequest and worked a little with it, but I haven't gotten into data islands or any other things like that. If you have an XML/JavaScript question, you might try asking in the XML or JavaScript forum (whichever is more appropriate).[/font]
@JonaMar 07.2005 — #[font=trebuchet ms]I'm experienced with both MySQL and flatfile databases (particularly with PHP). I don't have a problem with you asking, but I'm curious as to why you are asking. Mind sharing that? ? [/font]
@JonaMar 08.2005 — #[font=trebuchet ms]That seems like a lot of work to convert to a flatfile database. You'd have to have a whole system "thingy" to go along with your PM "thingy," and as a result would have to do a lot more converting than just the PM part. Anyway, glad to see you like my Chategory software. ? [/font]
@emblemauthorJul 23.2005 — #any way well thanks alot for your help it was Extreamly helpful and now because of you i understand fopen/fread ect. (i think).