extracting a file from a zip file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KingAdnan
    New Member
    • Mar 2008
    • 1

    extracting a file from a zip file

    Hello friends, i am new here, i need help, i am making script for users who will upload zip file and the script will look for index.html inside zip, if it success to find it, it should echo all content of that index.html as a web page, here is my code:

    Code:

    Code:
    <?
    
    $f = "c:/PHPServer/template.zip";
    
    $zip = zip_open($f);
    if($zip)
     {
        while($read = zip_read($zip))
    	{
    	$file = zip_entry_name($read);
    	
    	if($file == "index.html")
    	 {
    	$open=fopen($f.zip_entry_name($read['index.html']),"r+");
             while(!feof($open))
       	{
    	    echo fgetc($open);
    	}
         }
       }
     }
    ?>
    Please tell me what should i do?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

    This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

    MODERATOR

    Comment

    Working...