Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Need help with code

Aloittaja Darkorical, helmikuu 11, 2008, 11:28:56 AP

« edellinen - seuraava »

Darkorical

alright I am attempting to build something similar  to Cafe Press' design your own section. thus far I have been hacking and slashing code together until finally I got something that functioned in firefox .. not so well in IE tho

below are the files, as I have I don't have it online yet. I am only building it locally using wamp

alright basically what I have done is taken a php script to read the contence of 2 (eventually to be increased to 3) directories and make links to each item inside the folder


$dir = opendir("SmHandles/");//List files in images directory
while (($file = readdir($dir)) !== false)
{
  echo "<a href=SmHandles/$file target=han><img src=./SmHandles/SelectorButtons/T$file /></a><br />";
  }
  closedir($dir);
?>


however this also lists "." and ".." as files I cant seem to figure out how to remove them

the target listed is an 1 of three iframes that currently are manually alligned on the screen to line up the images.

also I have taken an image upload/edit script (Pim-2.0) and hacked it to peices and dumped it in as well to allow for personal logos to be uploaded and placed into the third Iframe

can someone take a look at this and see if someone else can come up with a better way of doing this or at least help clean up what I have.

here is a link to a zip file of what Im doing
Virtual Builder

jamesk

Taken directly from PHP.net (http://us3.php.net/readdir)

<?php
if ($handle opendir('.')) {
    while (
false !== ($file readdir($handle))) {
        if (
$file != "." && $file != "..") {
            echo 
"$file\n";
        }
    }
    
closedir($handle);
}
?>

Darkorical

thanks for the help with that now any advice on makeing the rest of it work nicer?

Advertisement: