PHP help needed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pics Traffic
    Confirmed User
    • Jun 2004
    • 3055

    #1

    PHP help needed.

    I need to delete a bunch of files from subdirectories that have "pix" string in its name.

    Is there way to do it with php script that I can run thru browser?
    sort of like doing comand but with a siple script.

    del /S *pix*
    My Network Is Waiting For Your Fuckin' Trade!
  • UniqueD
    Confirmed User
    • Aug 2004
    • 1022

    #2
    youre going to have to write a script that looks through the directories recursively and checks the file names for the string. Its def doable.

    Comment

    • quantum-x
      Confirmed User
      • Feb 2002
      • 6863

      #3
      This will do the trick.

      PHP Code:
      <?
      foreach(globr('/path/to/dirname/','*pix*') as $v) unlink($v);
      function globr($sDir, $sPattern, $nFlags = NULL) { 
        $sDir = escapeshellcmd($sDir); 
        $aFiles = glob("$sDir/$sPattern", $nFlags); 
        foreach (glob("$sDir/*", GLOB_ONLYDIR) as $sSubDir) 
        { 
          $aSubFiles = globr($sSubDir, $sPattern, $nFlags); 
         $aFiles = array_merge($aFiles, $aSubFiles); 
        } 
        return $aFiles;  } 
      ?>
      PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

      Comment

      • quantum-x
        Confirmed User
        • Feb 2002
        • 6863

        #4
        Originally posted by UniqueD
        youre going to have to write a script that looks through the directories recursively and checks the file names for the string. Its def doable.
        No shit sherlock :P
        PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

        Comment

        • Pics Traffic
          Confirmed User
          • Jun 2004
          • 3055

          #5
          Originally posted by UniqueD
          youre going to have to write a script that looks through the directories recursively and checks the file names for the string. Its def doable.

          I wish I would have thought of that.
          My Network Is Waiting For Your Fuckin' Trade!

          Comment

          • Pics Traffic
            Confirmed User
            • Jun 2004
            • 3055

            #6
            Originally posted by quantum-x
            This will do the trick.

            PHP Code:
            <?
            foreach(globr('/path/to/dirname/','*pix*') as $v) unlink($v);
            function globr($sDir, $sPattern, $nFlags = NULL) { 
              $sDir = escapeshellcmd($sDir); 
              $aFiles = glob("$sDir/$sPattern", $nFlags); 
              foreach (glob("$sDir/*", GLOB_ONLYDIR) as $sSubDir) 
              { 
                $aSubFiles = globr($sSubDir, $sPattern, $nFlags); 
               $aFiles = array_merge($aFiles, $aSubFiles); 
              } 
              return $aFiles;  } 
            ?>

            thanks man.
            My Network Is Waiting For Your Fuckin' Trade!

            Comment

            • UniqueD
              Confirmed User
              • Aug 2004
              • 1022

              #7
              why the fuck did you ask if there was a way to do it if you already knew there was then?

              Comment

              • quantum-x
                Confirmed User
                • Feb 2002
                • 6863

                #8
                Originally posted by UniqueD
                why the fuck did you ask if there was a way to do it if you already knew there was then?
                Keep digging!
                PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                Comment

                • camperjohn64
                  Confirmed User
                  • Feb 2005
                  • 1531

                  #9
                  Originally posted by UniqueD
                  why the fuck did you ask if there was a way to do it if you already knew there was then?
                  I am speachless...
                  www.gimmiegirlproductions.com

                  Comment

                  • woj
                    <&(©¿©)&>
                    • Jul 2002
                    • 47882

                    #10
                    Originally posted by MOCKBA
                    I wish I would have thought of that.
                    Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                    Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                    Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                    Comment

                    • Pics Traffic
                      Confirmed User
                      • Jun 2004
                      • 3055

                      #11
                      Originally posted by UniqueD
                      why the fuck did you ask if there was a way to do it if you already knew there was then?
                      Please turn off your internet connection.
                      My Network Is Waiting For Your Fuckin' Trade!

                      Comment

                      • gornyhuy
                        Chafed.
                        • May 2002
                        • 18041

                        #12
                        Originally posted by MOCKBA
                        Please turn off your internet connection.
                        Is there a way to turn off your internet connection?

                        icq:159548293

                        Comment

                        • Pics Traffic
                          Confirmed User
                          • Jun 2004
                          • 3055

                          #13
                          Originally posted by quantum-x
                          This will do the trick.

                          PHP Code:
                          <?
                          foreach(globr('/path/to/dirname/','*pix*') as $v) unlink($v);
                          function globr($sDir, $sPattern, $nFlags = NULL) { 
                            $sDir = escapeshellcmd($sDir); 
                            $aFiles = glob("$sDir/$sPattern", $nFlags); 
                            foreach (glob("$sDir/*", GLOB_ONLYDIR) as $sSubDir) 
                            { 
                              $aSubFiles = globr($sSubDir, $sPattern, $nFlags); 
                             $aFiles = array_merge($aFiles, $aSubFiles); 
                            } 
                            return $aFiles;  } 
                          ?>

                          worked well. thanks again
                          My Network Is Waiting For Your Fuckin' Trade!

                          Comment

                          Working...