Hi, I am making a file manager page allows you to edit the the file you choose but I am running into an error I don't understand nor no how to fix if any of you can fix it I will be greatful heres my code:
I get this error message:
When I take the ")" out of the 6th last line it gives me this error:
| Code: |
|
<?php include ('protect.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Control Panel</title> <style type="text/css"> <!-- .style1 {font-family: Arial, Helvetica, sans-serif} --> </style> <script type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body onLoad="MM_preloadImages('images/images/News-Over.png','images/images/File-Manager-Over.png','images/images/New-Page-Over.png','images/images/Users-Over.png','images/Help-Over.png')"> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="120" width="150" align="center" valign="middle" cellpadding="0" cellspacing="0"><a href="main.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('News','','images/News-Over.png',1)"><img src="images/News.png" alt="News" name="News" border="0" id="News" /></a></td> <td height="120" width="150" align="center" valign="middle" cellpadding="0" cellspacing="0"><a href="filemanager.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('File Manager','','images/File-Manager-Over.png',1)"><img src="images/File-Manager.png" alt="File Manager" name="File Manager" border="0" id="File Manager" /></a></td> <td height="120" width="150" align="center" valign="middle" cellpadding="0" cellspacing="0"><a href="newpage.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('New Page','','images/New-Page-Over.png',1)"><img src="images/New-Page.png" alt="New Page" name="New Page" border="0" id="New Page" /></a></td> <td height="120" width="150" align="center" valign="middle" cellpadding="0" cellspacing="0"><a href="users.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Users','','images/Users-Over.png',1)"><img src="images/Users.png" alt="Users" name="Users" border="0" id="Users" /></a></td> <td height="120" width="150" align="center" valign="middle" cellpadding="0" cellspacing="0"><a href="help.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Help','','images/Help-Over.png',1)"><img src="images/Help.png" alt="Help" name="Help" border="0" id="Help" /></a></td> </tr> </table> <table width="750" border="1" align="center"> <tr> <td width="100%" align="center" valign="top" align="center"> <?php if (isset($_GET['action'])) { switch (strtolower($_GET['action'])) { case 'delete' : do_delete(@$_GET['what']); break; case 'download' : do_download(@$_GET['what']); break; case 'showimg' : do_showimg(@$_GET['what']); break; case 'edit' : do_edit(@$_GET['what']); break; default : break; } } // path to the folder listed - can be full path //$path = "/var/www/html/"; //or relative path $path = "../"; // Open the folder for display $dir_handle = @opendir($path) or die("Unable to open $path"); // Loop through the files while (false !== ($file = readdir($dir_handle))) { // do not display current file if($file == "controlpanel") continue; if($file == ".") continue; if($file == "..") continue; if($file == "filemanager.php") continue; // Display file links echo "<table border=\"1\" width=\"100%\" align=\"center\">"; echo "<tr><td><a href=\"$file\" target=\"blank\"><img src=\"images/file.PNG\" border=\"0\"></a> <a href=\"$file\" target=\"blank\">$file</a></td><td width=\"17\" height=\"17\"><a href=\"$file\" target=\"blank\"><img src=\"images/view.PNG\" border=\"0\"></a></td><td width=\"17\" height=\"17\"><a href=\"filemanager.php?action=edit&what=$file\"><img src=\"images/edit.PNG\" border=\"0\"></a></td><td width=\"17\" height=\"17\"><a href=\"filemanager.php?action=delete&what=$file\"><img src=\"images/delete.PNG\" border=\"0\"></a></td></tr>"; echo "</table>"; } // Close directory closedir($dir_handle); function do_delete($file) { if ($file == '') return false; /* do nothing for empty file names */ // now you can delete it return unlink($file); } function do_edit($file) { echo " include(\"FCKeditor/fckeditor.php\") ; include(\"protect.php\"); <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" /> <title>Control Panel</title> <style type=\"text/css\"> <!-- .style1 {font-family: Arial, Helvetica, sans-serif} --> </style> <script type=\"text/JavaScript\"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf(\"#\")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf(\"?\"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body link=\"#FFCC00\" vlink=\"#FFCC00\" alink=\"#FFCC00\" onload=\"MM_preloadImages('images/images/News-Over.png','images/images/File-Manager-Over.png','images/images/New-Page-Over.png','images/images/Users-Over.png','images/images/Help-Over.png')\"> <table width=\"750\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td height=\"120\" width=\"150\" align=\"center\" valign=\"middle\" cellpadding=\"0\" cellspacing=\"0\"><a href=\"main.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('News','','images/News-Over.png',1)\"><img src=\"images/News.png\" alt=\"News\" name=\"News\" border=\"0\" id=\"News\" /></a></td> <td height=\"120\" width=\"150\" align=\"center\" valign=\"middle\" cellpadding=\"0\" cellspacing=\"0\"><a href=\"filemanager.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('File Manager','','images/File-Manager-Over.png',1)\"><img src=\"images/File-Manager.png\" alt=\"File Manager\" name=\"File Manager\" border=\"0\" id=\"File Manager\" /></a></td> <td height=\"120\" width=\"150\" align=\"center\" valign=\"middle\" cellpadding=\"0\" cellspacing=\"0\"><a href=\"newpage.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('New Page','','images/New-Page-Over.png',1)\"><img src=\"images/New-Page.png\" alt=\"New Page\" name=\"New Page\" border=\"0\" id=\"New Page\" /></a></td> <td height=\"120\" width=\"150\" align=\"center\" valign=\"middle\" cellpadding=\"0\" cellspacing=\"0\"><a href=\"users.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Users','','images/Users-Over.png',1)\"><img src=\"images/Users.png\" alt=\"Users\" name=\"Users\" border=\"0\" id=\"Users\" /></a></td> <td height=\"120\" width=\"150\" align=\"center\" valign=\"middle\" cellpadding=\"0\" cellspacing=\"0\"><a href=\"help.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Help','','images/Help-Over.png',1)\"><img src=\"images/Help.png\" alt=\"Help\" name=\"Help\" border=\"0\" id=\"Help\" /></a></td> </tr> </table> <table width=\"750\" border=\"1\" align=\"center\"> <tr> <td width=\"659\" align=\"center\" valign=\"top\" align=\"center\"> <form name=\"input\" method=\"post\" action=\"edit.php\"> Editing: $file <p> <p><label for=\"content\">Content: </label> $ourFileName = \"$file\"; $fh = fopen($ourFileName, 'r') or die(\"Can't open file\"); $contents = fread($fh, filesize($ourFileName)); $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->BasePath = 'FCKeditor/'; $oFCKeditor->Value = \"$contents\" ; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '600' ; echo $oFCKeditor->CreateHtml(); fclose($fh); </p> </p> <p><input type=\"submit\" name=\"submit\" value=\"submit\" /></p> </form> </td> </tr> </table> </body> </html> "; ) ?> </body> </html> |
I get this error message:
| Quote: |
|
Parse error: syntax error, unexpected ')' in /home/cr3ativ3/domains/oyoystudios.frih.net/public_html/DynamicDesignCP/filemanager.php on line 192 |
When I take the ")" out of the 6th last line it gives me this error:
| Quote: |
|
Parse error: syntax error, unexpected $end in /home/cr3ativ3/domains/oyoystudios.frih.net/public_html/DynamicDesignCP/filemanager.php on line 197 |
