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


Getting PHP variable to work in FCKeditor





cr3ativ3
Ok, I once had this working but then I deleted the file. Ok I am trying to load a php variable into the FCKeditor so here is my code:

Code:

<?php

$ourFileName = "template.html";
$fh = fopen($ourFileName, 'r') or die("Can't open file");

$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = 'FCKeditor/';
$oFCKeditor->Value = "$fh" ;
$oFCKeditor->Width  = '100%' ;
$oFCKeditor->Height = '600' ;
echo $oFCKeditor->CreateHtml();
fclose($fh);
?>


So as you can see I am opening the file template.html and then loading the variable into the edit by sticking it here:

Code:
$oFCKeditor->Value = "$fh" ;


But when I do this all that shows up in the editor is: Resource id #5

For those of you who don't know about FCKeditor its basically a javascript webpage editor that acts like form text area and the code shown above where the variable is loaded is the value of it.

Now this should be working but its not and I can't figure out why it doesn't load the page into the editor just Resource id #5.

If someone could help me out with this I would be very gratefull.
hexkid
cr3ativ3 wrote:
But when I do this all that shows up in the editor is: Resource id #5


You need to fopen(), fread(), fclose() or, maybe simpler, file_get_contents()

fopen
fread
fclose
file_get_contents
cr3ativ3
that was it lol it worked perfectly I don't know how to thank you.
Related topics
Dynamic PHP Images
Dynamic User Customizable Sites. CSS + PHP = Awesome!
Do we support php include and/or SSI?
PHP index page not displaying problem
easyphp help 4 total noob - take 1 second of your time plz
Countdown Javascript with PHP variables
storing current page address as php variable
Need Help integrating php variable into mySQL SELECT query
PHP variable problem
PHP5 MySQL Config on XP
PHP 5 on sever 2 has NOT found its first victom.
time related problem
TMP File Problem
removing DirectAdmin part of URL makes php code work
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.