Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/01/2010, 10:43
Yurisimo
 
Fecha de Ingreso: julio-2009
Mensajes: 111
Antigüedad: 14 años, 9 meses
Puntos: 0
Problema con instalacion de fckeditor

Hola muy buenas, me he bajado el FCKeditor 2.6.3 y lo he intentado instalar pero no me va... :S La pagina me da un error....

He utilizado un metodo de instalacion que encontre en una guia en internet :
1er paso

Creamos una carpeta bajo el nombre de FCKeditor (o el de tu gusto) donde colocaremos el codigo que viene en la carpeta editor (cuando lo descarguemos), con esto hecho procedemos a llamar al JavaScript, dentro de las etiquetas head colocamos:

<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>

2do paso

Ahora lo único que falta es crear el formulario

Método 1
Un primer metodo es ubicarnos dentro de la etiqueta body, en el lugar donde queremos que vaya el formulario y colocar lo siguiente:

<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.Create() ;
</script>



Bueno os dejo el codigo de mi php a ver si me podeis ayudar... ya q no me funciona...



Código PHP:
<?php  
if (isset ($_POST['publicar']) ) {
    
    
$titulo=false;
    
$resumen=false;
    
$noticia=false;
    
$autor=false;
    
    
//TITULO
    
if (empty ($_POST['titulo'])) {
    
$msg='El campo titulo es obligatorio. ';
    
    }else{
    
$titulo=true;
    
$tituloBlog =htmlspecialchars ($_POST['titulo']);
    
//inutilizamos html con htmlspecialchars
    
}
    
    
    
// RESUMEN
        
if (empty ($_POST['resumen'])) {
    
$msg.='El campo resumen es obligatorio. ';
    
    }else{
    
$resumen=true;
    
$resumenBlog =nl2br(htmlspecialchars ($_POST['resumen']));
    
//Conservamos los saltos de linea con la funcion nl2br...
    
}
    
    
    
//NOTICIA
        
if (empty ($_POST['noticia'])) {
    
$msg.='El campo noticia es obligatorio. ';
    
    }else{
    
$noticia=true;
    
$noticiaBlog =nl2br(htmlspecialchars ($_POST['noticia']));
    }
    
    
    
//AUTOR
        
if (empty ($_POST['autor'])) {
    
$msg.='El campo autor es obligatorio. ';
    
    }else{
    
$autor=true;
    
$autorBlog =htmlspecialchars ($_POST['autor']);
    }
    
    
    
    if (
$titulo && $resumen && $noticia && $autor) {
    
$fecha time();
    require_once(
'cnx.php');
    
    
$sql "INSERT INTO noticias (titulo, resumen, noticia, fecha, autor) VALUES ('$tituloBlog','$resumenBlog','$noticiaBlog',$fecha,'$autorBlog')";
    
    if(
mysql_query($sql$idcon)) {
      
$msg'Noticia insertada con exito!';
    }else{
    
$msg'Error en la insercion';
    }
    
    }
    
    
}
?> 
<!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>
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor('noticia') ;
oFCKeditor.ReplaceTextarea() ;
}
</script> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form1" id="form1">
<table width="800" align="center" bgcolor="#CCFF99" border="1" bordercolor="#000066" cellspacing="0" cellpadding="8">
  <tr>
    <td bgcolor="#48c4f7" colspan="2"><img src="img/head.jpg" width="810" height="180" alt="b" /></td>
  </tr>
  <tr>
    <td bgcolor="#48c4f7" align="center" colspan="2"><h2 align="center">Alta Noticias </h2>
      <p align="center"><p><?php echo $msg?></p></td>
    </tr>
  <tr>
    <th width="114"><label for="titulo">Titulo</label></th>
    <td width="646">
      <input type="text" name="titulo" id="titulo" value="<?php echo $_POST['titulo']; ?>" /></td>
  </tr>
  <tr>
    <th><label for="resumen">Resumen</label></th>
    <td>
      <textarea name="resumen" id="resumen" cols="45" rows="3"><?php echo $_POST['resumen']; ?></textarea></td>
  </tr>
  <tr>
    <th> <label for="noticia">Su noticia</label></th>
    <td>
    <textarea name="noticia" id="noticia" cols="65" rows="7"><?php echo stripslashes($_POST['noticia']); ?></textarea></td>
  </tr>
  <tr>
    <th><label for="autor">Autor</label></th>
    <td>
      <input name="autor" type="text" id="autor" value="<?php echo $_POST['autor']; ?>" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="center"><input type="submit" name="publicar" id="publicar" value="Publicar" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><p align="center"><a href="../index.php">[ volver a inicio ]</a></p></td>
  </tr>
</table>

</form>
</body>
</html>
Muchisimas gracias...