Jump to content

Jas0n

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Jas0n's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yup that fixed it! just one more simple thing... at the moment its doing this a b c d e f g h i j etc... for some reason its not filling the first row. Any ideas? Thanks again, Jase
  2. Looks like only half of them
  3. Just given your code a bash and it seems like its not displaying all of the images from the directory. Any Ideas? Thanks for your reply, Jase
  4. Hi again, Thanks for the quick replys! Heres what I've tried, with using code from the "Multi-column Results" snippet. <?php $websiteurl = 'http://www.xxxxx.co.uk/beta/'; $dir = "images/fascinators/mandy/"; // *********************************** Functions function RemoveExtension($strName) { $ext = strrchr($strName, '.'); if($ext !== false) { $strName = substr($strName, 0, -strlen($ext)); } return $strName; } // ********************************************* $dh = opendir($dir); $i = 0; $max_columns = 3; echo '<table cellspacing="3" cellpadding="3">'; while (($file = readdir($dh)) !== false) { $blah = $websiteurl.$dir.$file; $ProductColourName = RemoveExtension($file); $ProductColourName = ucwords($ProductColourName); if(($file != ".") and ($file != "..")) { // open row if counter is zero if($i == 0) { echo '<tr><td><img src="'. $blah .'" alt="'. $blah .'" name="'. $blah .'" width="147" height="146" /></td>'; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo '</tr>'; $i=0; } // end if } // end while // clean up table - makes your code valid! if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo '<td> </td>'; } //echo '<tr><td><img src="'. $blah .'" alt="'. $blah .'" name="'. $blah .'" width="147" height="146" /><br></td></tr>'; //echo '<tr><td><a href="'. $blah .'">'. $ProductColourName .'</a><br></td></tr>'; } } echo '</tr>'; echo '</table>'; closedir($dh); ?> I'm not having much luck as only one image is appearing. Anyone have any ideas? Thanks, Jase
  5. Hi Guys, I'm currently trying to populate a table from reading images from a folder. Heres my code which works perfectly, however I would like to display the images like this: a b c e f g h etc... rather in this format of table.. a b c d e f g etc... I hope this makes sense! <?php $websiteurl = 'http://www.xxxxx.co.uk/beta/'; //$ProductCatFolder = ; //$ProductImageFolder = $product_info['products_model']; $dir = "images/fascinators/mandy/"; // *********************************** Functions function RemoveExtension($strName) { $ext = strrchr($strName, '.'); if($ext !== false) { $strName = substr($strName, 0, -strlen($ext)); } return $strName; } // ********************************************* $dh = opendir($dir); echo '<table width="450" border="0">'; while (($file = readdir($dh)) !== false) { $blah = $websiteurl.$dir.$file; $ProductColourName = RemoveExtension($file); $ProductColourName = ucwords($ProductColourName); if(($file != ".") and ($file != "..")) { echo '<tr><td><img src="'. $blah .'" alt="'. $blah .'" name="'. $blah .'" width="147" height="146" /><br></td></tr>'; echo '<tr><td><a href="'. $blah .'">'. $ProductColourName .'</a><br></td></tr>'; } } echo '</table>'; closedir($dh); ?> Any help would be much appreciated! Thanks again, Jase
  6. Hi Guys, I'm using a listmenu to storage engineers names, however I'm trying to load the engineers name from the database so I can update the record. echo "Job Details<br>"; echo "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"updateAddJob\" id=\"formupdateJob\">"; echo "<select name=\"listEngineer\" id=\"listEngineer\">"; echo "<option value=\"Jason\" selected=\"selected\">Jason</option>"; echo "<option value=\"Paul\">Paul</option>"; echo "</select>"; For this particular job 'Paul' is the engineers name stored in the database. How could I select his name instead etc...? I hope you guys understand what I'm trying to do. Thanks for the help, Jas0n
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.