I am reading a directory and getting a list of folders in the directory, I want to display the folders in a table which is 6 columns of results across by how ever may rows, here is the code I am using now which gets the folders and displays the table correctly, but it is currently only displaying the first result in an infinite loop.
Code: <?php
$d='action'; #define which dir you want to read
$dir = opendir($d); #open directory
while ($f = readdir($dir)) {
/* echo '<a href="'.$f.'/index.htm" target="_parent"><img src="'.$d.'/'.$f.'/folder.jpg" border="0"></a>
'; */
if ($f!="." && $f!=".." && (!is_file($f))) {
echo '<table cellspacing="5" cellpadding="4" align="center">';
$tdcount = 1;
while ($f) {
if($tdcount % 6 == 1) echo "<tr>";
echo '<td><font face="arial" size="1">';
echo '<a href="'.$f.'/index.htm" target="_parent"><img src="'.$d.'/'.$f.'/folder.jpg" border="0"></a></td>';
if($tdcount % 6 == 0) echo "</tr>";
$tdcount++;
}
echo "</table>";
}
}
?>How do i make it display each result instead of only the first result.
Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had to do with method overloading or overriding(through inheritence). The following wikipedia entry
SuperCali PHP Event Calendar
does anyone have any experience with the SuperCali PHP Event Calendar? I could use some assistance in writing a custom function for it, anyone ever messed with it before?
Comma seperated implode & modifying returned string.
I have a PHP post form that posts up to 4 variables. I need whatever variables are passed to be combined into one comma seperated string (eg variable1,variable2,variable3,variable4). This i can do
Prevention Help
How can I use PHP or any other language (feel free to move this thread) to prevent users doing screenshots of the website (maybe Java??) so if anyone knows how I can achieve this please post. Or how
Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.I have maxminds geoip lite installed and it works fine can retrieve the country and a city state every time no problem but it is not accurate it gets
I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bunch of new images thanks to a new camera, but in using Picasa to bulk export smaller images sizes,
Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to retrieving and displaying data, but if I click on a valid link in the following code, the content and
help, header() is not working!
Hello, I have this code:<?php/** * @author samoi * @copyright 2009 */error_reporting(E_ALL & E_NOTICE);include ('func.php'); // this has the session_start() func!if
Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a new user when I'm not logged in. It should redirect me back to the login page but I get this
Passing Arguments to execlp()
I'm writing a program that mimics a unix shell. It's supposed to take commands with arguments and execute them. I'm having trouble passing in the arguments into the execlp call to correctly execute