FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Error I can't seem to fix.





cr3ativ3
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:

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
hexkid
cr3ativ3 wrote:
Code:

/* ... */

function do_edit($file) {

echo "

/* ... */

</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


The echo I kept from your code ends on the line with the ")".
I believe it should end sooner, but I'm not going to try to find out where Smile
MrBlueSky
This is bad coding. Use a here document instead of one long echo

Besides that: you are mixing PHP with HTML without using the needed <?PHP tags

For example, instead of

Code:

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>


you should write:

Code:

<?php

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>
cr3ativ3
The reason I took the <?php and ?> tags out of the echo is because it was ending the actually php page for the whole page at the spot of these tags leaving the last ?> doing nothing.

I will try finding the end after looking at my code some more I think I have a theory of why it doesn't work. I will report back on whether I was right or not.
cr3ativ3
Yep it worked I used the ")" as the ending of the function when I should have been using "}" one small mistake between to very similar characters. Thanks for all the people that tried to help.

But now I have a new problem. Here is my code now using what MrBlueSky suggested:


Code:

function do_edit($file) {

echo <<<html
<form name="input" method="post"
action="edit.php">

Editing: $file

<p>

<p>

<?php
$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>
"
html;
}


?>
</body>
</html>


The error I get when using what he suggested is this:

Quote:

Parse error: syntax error, unexpected $end in /home/cr3ativ3/domains/oyoystudios.frih.net/public_html/DynamicDesignCP/filemanager.php on line 141


When I used the quotes instead of "<<<html html;" it worked but the editor wouldn't show. This script has been causing me lots of problems and I would pay someone 40frih$ to get it working or atleast give me the changes to the script to get it working properly.

Thanks
MrBlueSky
The code from your first post still contains some more errors.

Here is the working version, which is grammatically correct (which offcourse doesn't mean it does what you want it to do Smile ):

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 exit("Unable to open $path");

// Loop through the files
while ($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
    ?>
    <table border="1" width="100%" align="center">
   <tr>
   <td>
   <a href="<? echo $file?>" target="blank">
   <img src="images/file.PNG" border="0"></a>
   <a href="<? echo $file?>" target="blank"><? echo $file?></a>
   </td><td width="17" height="17">
   <a href="<? echo $file?>" target="blank">
   <img src="images/view.PNG" border="0"></a>
   </td><td width="17" height="17">
   <a href="filemanager.php?action=edit&what=<? echo $file?>">
   <img src="images/edit.PNG" border="0"></a>
   </td><td width="17" height="17">
   <a href="filemanager.php?action=delete&what=<? echo $file?>">
   <img src="images/delete.PNG" border="0"></a></td></tr>";
   </table>
   
<?php
}

// 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) {

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: <?php echo $file ?>

<p>

<p><label for="content">Content: </label>

<?php

$ourFileName = "$file";
$fh = fopen($ourFileName, 'r') or exit("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>


Hope this helps
cr3ativ3
Awsome thanks there were a few errors in that but I was able to get rid of them so ya i'll send you those $frih now.

Thanks So Much!
Runescapetown
wowa alot of writing..
\

i cant help soz Sad
cr3ativ3
I don't meen to be rude but I hope you are not spamming because if you had read the topic you would have known that the other poster helped me get it working. In which case you would have known I didn't need help.
Related topics
How To : Improve Your PHP Programming
403 Forbidden Error
150 $FRIH T VALIDATE my page
configure: error: xml2-config not found. Need help!
What is Your Hard Disk Size?
Need help: Error in Wordpress file
MySQL/PHP Error..
SMTP error
sql problem
SMF forum error?
[URGENT]Simple authentification does not work!!!
What error is this??
how to solve that error .. mysql_num_rows() ....
What's the most complicated piece of code you've ever wrote
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.