/    Sign up×
Community /Pin to ProfileBookmark

Hi, I have a php script that I am using to post articles on my website, the script to post them is as follows

[CODE]<b>Post</b>
<form action=”?<?php print $_SERVER[‘QUERY_STRING’]; ?>” method=”post”>
<p>
Title:<br>
<input name=”title” size=”40″><br>
Content:<br>
<textarea cols=”80″ name=”content” rows=”24″></textarea><br><br>
<input checked name=”html” type=”checkbox”> Allow HTML?<br><br>
<input type=”submit” value=”Post”>
</p>
</form>
[/CODE]

I am trying to integrate FCK using this URL[URL=”http://wiki.fckeditor.net/Developer%27s_Guide/Integration/PHP”]http://wiki.fckeditor.net/Developer%27s_Guide/Integration/PHP[/URL] so that I can edit text add pictures etc in the form, but I really can not figure out how to do it?

Can anyone help please and guide me on how I add it to my form 🙂

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@markandkelleauthorOct 30.2007 — [CODE]<b>Post</b>
<?php
include("FCKeditor/fckeditor.php") ;
?>
<form action="?<?php print $_SERVER['QUERY_STRING']; ?>" method="post">
<p>
Title:<br>
<input name="title" size="40"><br>
<br>


<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$sValue = stripslashes( $_POST['content'] ) ;
$oFCKeditor->BasePath = '/mywebsite/FCKeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create() ;
?>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Post">
</p>
</form>
[/CODE]


So I tried this, but that doesent seem to work? I am really shooting in the dark here, any ideas please?
Copy linkTweet thisAlerts:
@markandkelleauthorOct 30.2007 — I DID IT! silly me!
Copy linkTweet thisAlerts:
@markandkelleauthorOct 30.2007 — Ok so the prob was that I did not have this in there

[CODE]<b>Post</b>
<?php
include("FCKeditor/fckeditor.php") ;
?>
<form action="?<?php print $_SERVER['QUERY_STRING']; ?>" method="post">
<p>
Title:<br>
<input name="title" size="40"><br>
<br>


<?php
$oFCKeditor = new FCKeditor('[COLOR="Red"]FCKeditor1[/COLOR]') ; [COLOR="red"]should say content not fckeditor[/COLOR]
$sValue = stripslashes( $_POST['content'] ) ;
$oFCKeditor->BasePath = '/mywebsite/FCKeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create() ;
?>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Post">
</p>
</form>[/CODE]

I am now createing a form to edit the article but can not get it to work, any idea what I need to add to make it work? I am sure I just have a small error here, please help

[CODE]<b>Edit article</b>
<?php
include("FCKeditor/fckeditor.php") ;
?>
<form action="?<?php print str_replace('&', '&amp;', $_SERVER['QUERY_STRING']);
?>" method="post">
<p>
Title:<br>
<input name="title" size="40" value="<?php print $edit_title_sava;
?>"><br>
Content:<br>
<?php
$oFCKeditor = new FCKeditor('content') ;
$sValue = stripslashes( $_edit['content'] ) ;
$oFCKeditor->BasePath = '/mywebsite/FCKeditor/';
$oFCKeditor->Value = $edit_content_sava;
$oFCKeditor->Create() ;
?><br><br>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Save">
</p>
</form>[/CODE]


any ideas?
×

Success!

Help @markandkelle spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...