Activity Stream
48,167 MEMBERS
6795 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6
  1.     
    #1
    Member

    Default PHP & unrar problem, please help

    Hello Guys,
    I am trying to make php script on unrar specific folder, this is the code i wrote so far :

    PHP Code: 
        $files=read_folder_directory($fullpath);
        foreach (
    $files as $key => $value)  {
            echo 
    $key;
            echo 
    "<br />";
            
    natsort($value);
            foreach(
    $value as $file) {
                
    //echo $file;
                 
    echo "$fullpath/$key/$file";
                 echo 
    "<br />";
                    echo 
    $string='unrar e -y'."$fullpath/$key/$file $fullpath/$key/";
                    echo 
    $exec exec($string);
                    echo 
    "<br />";
                 
            }
        } 
    now if i paste the $string output into the shell it does work and extract the filers, however the $exec returns "No files to extract"

    any advice will be appreciated

    Thanks
    dima1236 Reviewed by dima1236 on . PHP & unrar problem, please help Hello Guys, I am trying to make php script on unrar specific folder, this is the code i wrote so far : $files=read_folder_directory($fullpath); foreach ($files as $key => $value) { echo $key; echo "<br />"; natsort($value); foreach($value as $file) { //echo $file; Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    digitalbattlefield.net imgnow.co
    I suspect it has to do with the quotes in this line

    PHP Code: 
    echo $string='unrar e -y'."$fullpath/$key/$file $fullpath/$key/"
    there is no space between the end of the unrar statement and the beginning of the file path.

    PHP Code: 
    echo $string='unrar e -y'.$fullpath/$key/$file $fullpath/$key/"
    Change it to that and see if it works.
    ?Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.?

  4.     
    #3
    Member
    Website's:
    tehMoviez.com 0Senes.com GeekFaceGames.com
    yep, patt1293 is right, try it, if it didnt work, give us an example of that line executed by the script

  5.     
    #4
    Member
    Website's:
    wautoposter.com
    i have made some change try this

    PHP Code: 
        $files=read_folder_directory($fullpath);
        foreach (
    $files as $key => $value)  {
            echo 
    $key;
            echo 
    "<br />";
            
    natsort($value);
            foreach(
    $value as $file) {
                
    //echo $file;
                 
    echo "'.$fullpath.'/'.$key.'/'.$file.'";
                 echo 
    "<br />";
                    echo 
    $string='unrar e -y "'.$fullpath.'/'.$key.'/'.$file.'" "'.$fullpath.'/'.$key.'/"';
                    echo 
    $exec exec($string);
                    echo 
    "<br />";
                 
            }
        } 

  6.     
    #5
    Member
    Website's:
    digitalbattlefield.net imgnow.co
    The way jpav did it will output the exact same results as the original.
    ?Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.?

  7.     
    #6
    Member
    Thanks all for the replies, it seems the PHP was correct lol, but the folder didn't have the correct permissions, sorry for that, and once again thank you for helping out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. unrar/rar problem in rapidleech
    By cyberchennai in forum Server Management
    Replies: 6
    Last Post: 30th Sep 2011, 02:31 PM
  2. Rapidleech rar unrar problem
    By onel0ve in forum Technical Help Desk Support
    Replies: 9
    Last Post: 5th Sep 2011, 04:16 PM
  3. Rapidleech Unrar Problem
    By congratz in forum Webmaster Discussion
    Replies: 2
    Last Post: 5th May 2011, 04:30 PM
  4. Rapidleech Rar-Unrar Problem
    By pappunsu in forum Technical Help Desk Support
    Replies: 0
    Last Post: 9th Apr 2011, 07:59 PM
  5. Rapidleech unrar Problem. Help!!
    By nYXem in forum Technical Help Desk Support
    Replies: 26
    Last Post: 4th Sep 2010, 03:15 PM

Tags for this Thread

BE SOCIAL