code,indexs,files,uploads,deletes,PLease,vote
Quick Search for:  in language:    
code,indexs,files,uploads,deletes,PLease,vote
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
PHP Stats

 Code: 74,754 lines
 Jobs: 12 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for PHP.
Smart Image Navigator
By Brian Di Croce on 10/27


Click here to see a screenshot of this code!Form security verification
By Christian Mallette on 10/26

(Screen Shot)

Click here to see a screenshot of this code!Guestbook
By Nightmare on 10/25

(Screen Shot)

Shout! Box
By Nightmare on 10/23


SERVER-TO-SERVE R site (or single dir) transfer
By Raffaele Marranzini on 10/22


Site IP Logger - Watch who comes to your site!
By KRaZY-DeSiGN on 10/21


IP Banner - Block unwanted people from your site!
By KRaZY-DeSiGN on 10/20


PWGen
By Flinn Mueller on 10/19


URHere
By Flinn Mueller on 10/19


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

File uploader/indexer

Print
Email
 
VB icon
Submitted on: 4/6/2002 2:53:37 PM
By: InteractiveWebGuys  
Level: Intermediate
User Rating: By 17 Users
Compatibility:PHP 3.0, PHP 4.0

Users have accessed this code 6120 times.
 

(About the author)
 
     This code indexs files, uploads, and deletes. PLease vote for me!

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    //**************************************
    //     
    // Name: File uploader/indexer
    // Description:This code indexs files, u
    //     ploads, and deletes. PLease vote for me!
    //     
    // By: InteractiveWebGuys
    //
    // Returns:It out puts a table to the br
    //     owser that shows each file.
    //
    // Side Effects:none as of now
    //
    //This code is copyrighted and has    // limited warranties.Please see http://
    //     www.Planet-Source-Code.com/xq/ASP/txtCod
    //     eId.594/lngWId.8/qx/vb/scripts/ShowCode.
    //     htm    //for details.    //**************************************
    //     
    
    <?php
    error_reporting(0);
    //this turns off error reporting we doth
    //     is so that we don't get a warning for th
    //     e $action variable
    $destination=".";
    //the directory that the script index's 
    //     if you want the current directory put a 
    //     "." if you want another folder
    //put "foldername"
    if ($action=='delete')
    {
    $del = unlink("./$destination/$fle");
    }
    echo '<FONT SIZE="+2" COLOR="FF9A00"><CENTER>File manager</CENTER></FONT><BR><BR><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=o><TR><TD ALIGN=center WIDTH=200 bgcolor=FFECCE><CENTER>Filename:</CENTER></TD><TD ALIGN=center WIDTH=200 bgcolor=FFECCE><CENTER>Functions:</CENTER></TD><TD ALIGN=center WIDTH=200 bgcolor=FFECCE><CENTER>Filesize(in bytes):</CENTER></TD><TD ALIGN=center WIDTH=150 bgcolor=FFECCE><CENTER>Filetype:</CENTER></TD><TD ALIGN=center WIDTH=150 bgcolor=FFECCE><CENTER>Created on:</CENTER></TD></TABLE>';
    $directory = opendir($destination);
    while( $file = readdir( $directory ) )
    {
    $file_ar[] = $file;
    }
    foreach( $file_ar as $file )
    {
    if( $file == ".." || $file == "." )
    {
    continue;
    }
    $type= strrchr($file,'.');
    $name=$file;
    $name2=$destination."/".$file;
    if($type==''){$type='dir';}
    $sizeoff=filesize($name2);
    $time=date("D M j Y",filectime($name2));
    if($time=='Wed Dec 31 1969'){$time='Unknown';}
    if($sizeoff==''){$sizeoff='Unknown';}
    if($sizeoff=='0'){$sizeoff='Unknown';}
    $file2 = dirname($name2);
    if($color == "FF9A00") {
    $color = "FFECCE";
    } else {
    $color = "FF9A00";
    }
    echo"<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=o><TR><TD ALIGN=center WIDTH=200 bgcolor='$color'><a href='$uname/$file' target=_blank>$name</a></font></TD><TD ALIGN=center WIDTH=200 bgcolor='$color'><A HREF='$PHP_SELF?action=delete&fle;=$file&der;=$uname'>Delete</A><TD ALIGN=center WIDTH=200 bgcolor='$color'>$sizeoff</TD> <TD ALIGN=center WIDTH=150 bgcolor='$color'>$type</TD><TD ALIGN=center WIDTH=150 bgcolor='$color'>$time</TD></TABLE>";
    }
    echo "<CENTER><FONT SIZE='+2' COLOR=\"FF9A00\"><BR><BR>Uploader</FONT></CENTER><BR><BR><FORM ACTION='$PHP_SELF' METHOD=post enctype=\"multipart/form-data\">File:<BR><INPUT TYPE='file' size='20' name='filename'><BR><CENTER> <input type=\"hidden\" name=\"action\" value=\"uploadProg\"><INPUT TYPE='hidden' name='action' value='upload'><INPUT TYPE='submit' value='Upload File'></CENTER></FORM>";
    closedir($directory);
    if($action==''){$action='noaction';}else{$action=$action;}
    if($action=='upload')
    {
    $filename==$filename_name;
    $action=('uploadprog');
    $destination=".";
    copy($filename,$destination."/".$filename_name);
    echo "<h2>File Uploaded.</h2>";
    echo "<HEAD><META HTTP-EQUIV='Refresh' CONTENT=1></HEAD>";
    }
    if ($filename=="none") {echo("<h1>No File Selected....</h1>"); break;}
    uploadProg($filename,$filename_name);
    break;
    ?>

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/6/2002 11:28:34 PM:kc
This code is excellent, well written 
and yet simple. I give it five globes! 
Good work!
~kc~
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/7/2002 9:58:40 AM:Eric
Well this was up and running in 5 
minutes. Great job and thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/14/2002 10:59:03 AM:D3ltaH0rse
Easy to use script and working in about 
3 
secs.
Cheers
http://clik.to/jezub
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/16/2002 8:26:52 AM:InteractiveWebGuys
lol this is funny wil willmek you voted 
my code 1 globe yet everybody else 
voted me 5 are you trying to make my 
score go down?!!?! lol some people or 
should i say some people's kids..
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/17/2002 9:50:25 PM:leet pSyCo
Smooth the rough edges... and what do 
you have?                  
International usage. 5 globes most 
definately.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/18/2002 2:49:31 AM:Jor
He PsychoGenius, DONT SCREW UP THIS 
SITE! I know you are rating other good 
codes with one globe. WE DONT LIKE 
CHEATERS HERE!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/18/2002 7:27:40 AM:InteractiveWebGuys
hmm tell wil wilimik that too he did 
the same thing to me rated my code with 
one globe, but yes psycho dont do that
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/19/2002 8:39:08 PM:Brandon Pawoll
lol this code is cool! I just got into 
php a few days ago, already know alot. 
lol great job man.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/30/2002 9:43:02 AM:Jor
I dont know what your doing but i dont 
like the fact that you are rating my 
code for the second time with bad 
ratings, the first time 1 globe and now 
two globes.
I you want to win the 
contest you should write better scripts 
so that you will get more votes instead 
of rating other codes with 1 globe!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/30/2002 12:19:40 PM:InteractiveWebGuys
heres the deal buddy..i rated your CODE 
ONE TIME UNO do you undertstand that. I 
rated it what i thought of it i dont 
give a crud how good my script is and i 
dont give a crud how good your script 
is. i also contacted planet-source-code 
about the rating thing and just TO LET 
YOU KNOW only the ratings  that are 5 
GLOBES AFFECT YOUR CODE!!!! so get off 
my back and get a life
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/10/2002 7:15:24 AM:mki
How to upload a file when Server 
require username and pass. This program 
refresh many times, but doesn't upload.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/11/2002 1:29:31 AM:InteractiveWebGuys
hmm maybe because it wasn't designed 
for that? dontcha think?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/19/2002 10:17:34 AM:Mark
I have entered the code exactly as it 
is on this page, no alterations. and 
uploaded to 
http://url.co.uk/directory
and the 
script displays the files in the table, 
but if I click one it is linking to 
http://url.co.uk  without the 
directory! how can I fix this? 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/19/2002 10:44:23 PM:
Up and runnnig as fast as can be! Great 
Script!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/23/2002 3:10:12 AM:
I love thi script.. but I need help. It 
does not seem to create a URL to the 
files location, it wont upload and no 
delete either, I have the php file in 
my webroot and it is pointing to my 
uploads/files folder, folder is 
writeable. I have no clue why. I am new 
to this. If some one could help i would 
be grateful. Thanx
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | PHP Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.