Re: FREE BEER FOR THE FIRST PERSON TO TELL ME WHY THIS KILLS MY PC

From: Date: Thu, 29 Mar 2001 15:32:11 +0000
Subject: Re: FREE BEER FOR THE FIRST PERSON TO TELL ME WHY THIS KILLS MY PC
References: 1  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-1191@lists.php.net to get a copy of this message
> OK, so I followed the RTFM directive & now it just crashes PHP ... Help? > > function save_selection(){ > global $clist; > $clist->freeze(); > $selection = $clist->selection; > while (($rowfill = $clist->selection[0]) !== null) { I'm not sure how this works, but are you sure that's right? To me it looks like you're sitting in an infinite loop. (Which would quite possibly kill your PC :-) > $write = popen('something.txt', 'w'); What are you trying to do here? popen() is used to open another process so you can either write to it's standard input, or read from it's standard output (on some OS's you can do both) Most likely you don't have a program called something.txt so it's not going to be able to open it. If you want to write to a file called 'something.txt' you should use fopen(), not popen() - the arguments are the same tho. Note that using 'w' will recreate the file each time - you could open it with 'a' mode to append to it, but it would be more efficient to open the file before you enter the loop and then close it when you're done. > fputs($write, $rowfill); > pclose($write); This should be fclose(). > } > if ($clist->selection[0] === null && $clist->focus_row >= 0) > $clist->select_row($clist->focus_row, -1); > $clist->thaw(); > focusback(); > } Hope this helps and I haven't missed the ball completely. :-) -- Michael.

« previous php.gtk (#1191) next »