[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 08-09-2005, 02:31 PM   #1 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


Need PHP help

PHP Code:
if(!"browseupload.php" == $entry && !"filemanager.php" == $entry) {
    echo
"<p><b><u>File</u></b>";
    echo
"<br><b>|----Name: </b>".$entry;
    echo
"<br><b>|----Link: </b><a href = \"/Uploads/browseupload.php?file=".$entry."&admin=yes\">View Image</a>";
    echo
"<br><b>|----Size: </b>".filesize($path."/".$entry)." bytes";
    echo
"<br><b>|----<u>Actions</u></b>";
    echo
"<br><b>|.....|----Delete: </b><a href = \"/Uploads/filemanager.php?file=".$entry."&action=880952delfile\">Go</a>";
    echo
"<br><b>|.....|----Rename: </b><a href = \"/Uploads/filemanager.php?file=".$entry."&action=482975renfile\">Go</a>";
    echo
"<br><b>|.....|----Copy: </b><a href = \"/Uploads/filemanager.php?file=".$entry."&action=285177copfile\">Go</a>";
}else {
    echo
"<p><b><u>System File</u></b>";
    echo
"<br><b>|----Name: </b>".$entry;
    echo
"<br><b>|----Link: </b><i>Disabled</i>";
    echo
"<br><b>|----Size: </b>".filesize($path."/".$entry)." bytes";
    echo
"<br><b>|----<u>Actions</u></b>";
    echo
"<br><b>|.....|----Delete: </b><i>Disabled</i>";
    echo
"<br><b>|.....|----Rename: </b><i>Disabled</i>";
    echo
"<br><b>|.....|----Copy: </b><i>Disabled</i>";
}
that PHP lists every file in \Uploads\ and gives options for what I want to do with it (its the admin controll panel for my image hosting site) before I added in the IF statement it listed all files, i added it in so that filemanagement.php and browseupload.php would be listed as system files but it lists all the files as system files now. What have I done wrong?



EDIT: ive fixed it.
Barrucadu is offline  
Old 08-09-2005, 02:43 PM   #2 (permalink)
Eating Pie
 
iNod's Avatar
 
Join Date: Nov 2004
Location: Canada
Posts: 2,289
126.05 NP$ (Donate)

iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of

Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
I strongly suggest you do a few things to your coding.

(1) Make sure you comment everything. If you have a problem somewhere on a complex script is is very easy to figure out what that certain function that gives you the error does. Rather than search through and having to read all the code.

(2) Try to add some spaces and increase the looking concept of the script.

But other than that I am glad you fixed it.

Flubel Web Studios
__________________
I feel old.
iNod is offline  
Old 08-09-2005, 03:02 PM   #3 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


PHP Code:
    $handle = opendir("./Uploads/");
    
$files[] = readdir($handle);
    
closedir($handle);
    foreach(
$files as $file_result) {
        if(
eregi($_GET['criteria'], $file_result)) {
            echo
"<p><b><u>File Found:</u></b>";
            echo
"<br><b>|----Name: </b>".$file_result;
            echo
"<br><b>|----Link: </b><a href = \"/Uploads/browseupload.php?file=".$file_result.">View Image</a>";
            echo
"<br><b>|----Size: </b>".filesize("/Uploads/".$file_result)." bytes";
        }
    }
That is supposed to open a directory, serach for a criteria (set on the previous page) and draw a little map, however nothing happenes. The criteria definatly should show a result, the criteria i'm using is "Region" the name of the file is "1145936334RegionMap..JPG" (yes two dots its a bug)
Barrucadu is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 11:35 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
Beware of PHP! PolurNET The Break Room 25 03-29-2005 03:04 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:47 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85