Need PHP help

Spacemail by SpaceshipSpacemail by Spaceship
Watch

Barrucadu

Established Member
Impact
64
PHP:
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.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
 
0
•••
PHP:
	$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)
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Payment Flexibility
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back