RE: [PHP] Re: Replacing datafile with array II

From: Date: Tue, 18 Sep 2001 11:47:01 +0000
Subject: RE: [PHP] Re: Replacing datafile with array II
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67699@lists.php.net to get a copy of this message
Woops! I actually got the listing to work by replacing $photos = file($retVal); with $photos = $retVal; :) But, there´s still a problem. The script doesn´t seem to be able to use the navigation part (print out the next and previous links). That part of the script looks like this: <?PHP //print out navigation links if(($start == 0) && ($next_start < $total_photos)){ //you're at the beginning of the photo gallery ?> <font face="arial, helvetica" size="2"><b> <a href="galleri.php?start=<?PHP print($next_start);?>">next page</a> </font></b> <?PHP } elseif (($start > 0) && ($next_start < $total_photos)){ //you're in the middle of the photo gallery ?> <font face="arial, helvetica" size="2"> <b><font color="#FF0000">&#171;</font> <a href="galleri.php?start=<?PHP print($prev_start); ?>">prev page</a></b></font> <b>|</b> <font face="arial, helvetica" size="2"> <b><a href="galleri.php?start=<?PHP print($next_start); ?>">next page</a> <font color="#FF0000">&#187;</font></b></font> <?PHP } elseif(($start == 0) && ($next_start > $total_photos)){ //you're in a photo gallery with only one page of photos ?> <?PHP } else { //you're at the end of the photo galley ?> <font face="arial, helvetica" size="2"> <b><font color="#FF0000">&#171;</font> <a href="galleri.php?start=<?PHP print($prev_start); ?>">prev page</a></b></font> <?PHP } ?> > -----Original Message----- > From: _lallous [mailto:elias_bachaalany@yahoo.com] > Sent: den 18 september 2001 13:46 > To: php-general@lists.php.net > Subject: [PHP] Re: Replacing datafile with array > > > works like a charm.... > > just initializet the $retVal function... > > $retVal = array(); > rest of script here.... > > "Daniel alsén" <d@mindbash.com> wrote in message > news:PGEGIELINOCCEHLENIOJKENGCCAA.d@mindbash.com... > > Hi, > > > > i am trying to replace a datafile wich contains the contents of a > directory > > with an array. > > I am reading the directory and am trying to pass the value to an array. > What > > am i doing wrong? Shouldn´t $retVal contain the direcory info? > > > > Also, is there a way to use the content of an array without getting the > word > > 'Array' at the start? > > > > $handle=opendir('.'); > > while (false !== ($file = readdir($handle))) > > > > if ($file != "." && $file != ".." && > > ereg(".jpg",$file)) { > > > > $retVal[count($retVal)] = $file; > > > > } > > > > # Daniel Alsén | www.mindbash.com # > > # d@mindbash.com | +46 704 86 14 92 # > > # ICQ: 63006462 | # > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#67699) next »