Integrando o FCKeditor com seu site em php
Posted dezembro 19th, 2009 by WillemPrimeiro passo baixe
http://sourceforge.net/projects/fckeditor/
Agora abra a página que você deseja utilizar o editor
Copie a pasta do fckeditor para o diretório do seu site no meu caso /www/willemallan/
// Coloque no cabeçalho da página que deseja usar o editor
include_once(”fckeditor/fckeditor.php”) ;
?>
Segunda parte e colocar o código do formulário
$oFCKeditor = new FCKeditor(’nome_do_campo’) ; // Nome do campo nesta linha
$oFCKeditor->BasePath = ‘/fckeditor/’ ;
$oFCKeditor->Value = ‘Este é tutorial do site RiBsystem. Você está usando o FCKeditor.’ ;
$oFCKeditor->Create() ;
?>
Código completo
include_once(”fckeditor/fckeditor.php”) ;
?>
<html>
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
</head>
<body>
<form action=”sampleposteddata.php” method=”post” target=”_blank”>
<?php
$oFCKeditor = new FCKeditor(’FCKeditor1′) ;
$oFCKeditor->BasePath = ‘fckeditor/’ ;
$oFCKeditor->Value = ‘<p>This is some <strong>sample text</strong>. You are using <a href=”http://www.fckeditor.net/”>FCKeditor</a>.</p>’ ;
$oFCKeditor->Create() ;
?>
<br>
<input type=”submit” value=”Submit”>
</form>
</body>
</html>
Dicas pode utilizar este campos para falar o tamanho do campo ou se quer que venha como design ou código fonte, ou se estiver restaurando um valor do campo joga como uma variavel
$texto = ‘Este é tutorial do site <strong>RiBsystem</strong>. Você está usando o <a href=”http://www.fckeditor.net/”>FCKeditor</a>.’;
$oFCKeditor = new FCKeditor(’nome_do_campo’) ; // Nome do campo nesta linha
$oFCKeditor->BasePath = ‘/fckeditor/’ ;
$oFCKeditor->Width = “750″;
$oFCKeditor->Height = “450″;
$oFCKeditor->ToolbarSet = “Default”;
$oFCKeditor->Value = $texto ; // valor do campo pegando de uma variavel do php
$oFCKeditor->Create() ;
?>
Tags: FCKeditor
Leave a Reply