NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Need PHP help

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-09-2005, 03:31 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
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>";
????: NamePros.com http://www.namepros.com/programming/114152-need-php-help.html
    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?
????: NamePros.com http://www.namepros.com/showthread.php?t=114152



EDIT: ive fixed it.
Barrucadu is offline  
Old 08-09-2005, 03:43 PM   #2 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,272
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, 04:02 PM THREAD STARTER               #3 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
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)) {
????: NamePros.com http://www.namepros.com/showthread.php?t=114152
            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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 12:35 PM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 10:09 AM
Beware of PHP! PolurNET The Break Room 25 03-29-2005 04:04 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:32 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger