PHP Script Duplicating

This is a discussion on "PHP Script Duplicating" within the PHP Forum section. This forum, and the thread "PHP Script Duplicating are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 27th, 2007, 21:17
Reputable Member
Join Date: Jan 2004
Location: California
Age: 19
Posts: 232
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via AIM to tox0tes
PHP Script Duplicating

I am trying to pull out all files from a certain folder and echo them in a certain way on the page. It works, but it creates duplicates of what I want echoed.
See example on http://www.tootscoffee.com/admin/test1.php

PHP: Select all

<?php
if ($handle opendir('art')) {
    while (
false !== ($file readdir($handle))) {
    
$outgoing substr_replace($file,"",-4);
    
$outgoing2 preg_replace('/(thumb)/','',$outgoing);
    if (
$outgoing2 != "") {
    echo 
"<div class='Float'><a rel='lightbox[roadtrip]' href='art/".$outgoing2.".jpg'><img src='art/".$outgoing2."thumb.jpg' alt='Picture 1' class='Pic' /></a></div>";
    
$i++;
    }
    }
    
closedir($handle);

}

?>
Reply With Quote

  #2 (permalink)  
Old Aug 27th, 2007, 21:38
Reputable Member
Join Date: Jan 2004
Location: California
Age: 19
Posts: 232
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via AIM to tox0tes
Re: PHP Script Duplicating

nevermind, i fixed it:

PHP: Select all

<?php
if ($handle opendir('art')) {
    while (
false !== ($file readdir($handle))) {
    if (
preg_match("/thumb/"$file)) { 
    echo 
""
    }
    else {
    
$outgoing substr_replace($file,"",-4);
    if (
$outgoing != "") {
    echo 
"<div class='Float'><a rel='lightbox[roadtrip]' href='art/".$outgoing.".jpg'><img src='art/".$outgoing."thumb.jpg' alt='Picture 1' class='Pic' /></a></div>";
    
$i++;
    }
    }
    }
    
closedir($handle);

}

?>
Reply With Quote
Reply

Tags
duplicate, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with this script korvix JavaScript Forum 1 May 28th, 2008 23:00
Just following the script... chrisomatix Introduce Yourself 3 Feb 27th, 2008 07:03
Js Ad Script laffin JavaScript Forum 0 Nov 28th, 2007 10:13
script help ehud36new JavaScript Forum 2 Nov 13th, 2007 13:15
duplicating movieclips twestasdf Flash & Multimedia Forum 6 Apr 14th, 2005 22:42


All times are GMT. The time now is 11:47.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43