Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    problema fckeditor editor

    Ho creato un form per inserire dei dati nel database e per il testo ho utilizzato fckeditor.
    fin quì tutto bene. se voglio modificare i dati, nel campo di fckeditor non mi fa inserire il codice php di estrazione dati. Negli altri campi utilizzo value="<?php ecc ecc ?>"
    nel value del campo fckeditor mi da errore.

    Possibili soluzioni?

    questo lo script:

    <?php require_once('../connessionex/wr08b.php'); ?>
    <?php

    if (isset($_GET['id_new'])) {
    $colname_contenuti = (get_magic_quotes_gpc()) ? $_GET['id_new'] : addslashes($_GET['id_new']); }
    mysql_select_db($database_wr08b, $wr08b);
    $query_contenuti = sprintf("SELECT * FROM news WHERE id_new = %s ", $colname_contenuti);
    $contenuti = mysql_query($query_contenuti, $wr08b) or die(mysql_error());
    $row_contenuti = mysql_fetch_assoc($contenuti);
    $totalRows_contenuti = mysql_num_rows($contenuti);
    ?>
    <head>
    <?php


    include("fckeditor.php") ;
    ?>


    <title>titotlo</title>
    </head><body style="background-color: rgb(229, 228, 218);" vlink="" alink="" link="">


    <center>
    <table width="750" cellspacing="1" cellpadding="1" >
    <tr><td valign="top">
    richiamo pagina</td></tr>

    <tr><td><center>
    <table width="750" bgcolor="white" cellpadding="2" solid
    style="border: 1px solid #A4A4A4;" cellpadding="3">

    <tr><td colspan="3" valign="top" bgcolor="#F2F5F6" solid
    style="border: 1px solid black;">richiamo menu</td></tr>
    <tr>

    <td width="750" valign="top">
    <table width="650">
    <tr>
    <td width="650" valign="top" bgcolor="#F2F5F6" solid
    style="border: 1px solid black;">
    <form action="nnotizia2.php" method="POST" >
    <table width="650" border="0" cellpadding="0">
    <tr>
    <td width="80">Titolo</td>
    <td width="550"><input name="titolo" type="text" size="80" value="<?php echo $row_contenuti['titolo_new']; ?>"></td>
    </tr>
    <tr>
    <td>Sezione</td>
    <td><?php
    $sql = mysql_query("SELECT id_sez ,titolo_sez FROM sezione");
    echo "<select name=\"sezione\">";
    while ($res = mysql_fetch_array($sql)){
    echo "<option value=\"".$res['id_sez']."\">".$res['titolo_sez']."</option>";
    } echo "</select>";
    ?></td>
    </tr>
    <tr>
    <td>Testo</td>
    <td><?php
    // Automatically calculates the editor base path based on the _samples directory.
    // This is usefull only for these samples. A real application should use something like this:
    // $oFCKeditor->BasePath = '/fckeditor/ar/' ; // '/fckeditor/ar/' is the default value.
    $sBasePath = $_SERVER['PHP_SELF'] ;
    $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;

    $oFCKeditor = new FCKeditor('FCKeditor1') ;
    $oFCKeditor->BasePath = $sBasePath ;
    $oFCKeditor->Value ="" ; ((questo è il problema in value non posso mettere codice))
    $oFCKeditor->Create() ;
    ?></td>
    </tr>

    <tr>
    <td>Logo </td>
    <td><?php
    $sql = mysql_query("SELECT titolo_sez ,logo_sez FROM sezione");
    echo "<select name=\"img_new\">";
    while ($res = mysql_fetch_array($sql)){
    echo "<option value=\"".$res['logo_sez']."\">".$res['titolo_sez']."</option>";
    } echo "</select>";
    ?></td>
    </tr>

    <tr>
    <td>Link1</td>
    <td><input name="link1" type="text" size="80" value="<?php echo $row_contenuti['link1_new']; ?>"></td>
    </tr>
    <tr>
    <td>Link 2</td>
    <td><input name="link2" type="text" size="80" value="<?php echo $row_contenuti['link2_new']; ?>"></td>
    </tr>
    <tr>
    <td>Altro 1 </td>
    <td><input name="altro1" type="text" size="80" value="<?php echo $row_contenuti['altro1_new']; ?>"></td>
    </tr>
    <tr>
    <td>Altro 2</td>
    <td><input name="altro2" type="text" size="80" value="<?php echo $row_contenuti['altro2_new']; ?>"></td>
    </tr>
    <tr>
    <td>Parole chiave</td>
    <td><input name="chiave_new" type="text" size="80" value="<?php echo $row_contenuti['chiave_new']; ?>"></td>
    </tr>


    </table>
    <input type="submit" name="submit" value="Invia">

    </form>

    </td></tr>
    <tr><td bgcolor="#F2F5F6" solid
    style="border: 1px solid black;">


    </td></tr>
    </table></td>
    <td width="100" valign="top" solid
    style="border: 1px solid black;">richiamo menu verticale
    </td>
    </tr></table>
    </td></tr>
    <tr><td valign="top">
    richiamo chiusura pagina</td></tr></table>
    </center></body>
    <?php

    mysql_free_result($contenuti);
    ?>

    Grazie

  2. #2
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027

    Re: problema fckeditor editor

    Originariamente inviato da eurospeed
    [...]
    Negli altri campi utilizzo value="<?php ecc ecc ?>"
    [...]
    Si perchè in quel caso stai intercalando del codice php in codice html

    es.

    codice:
    <input name="titolo" type="text" size="80" value="<?php echo $row_contenuti['titolo_new'];?>" />
    Nel caso della creazione di fckeditor invece sei già all'interno di un blocco php, quindi ti basteerà:
    codice:
    <?php
    // Automatically calculates the editor base path based on the _samples directory.
    // This is usefull only for these samples. A real application should use something like this:
    // $oFCKeditor->BasePath = '/fckeditor/ar/' ; // '/fckeditor/ar/' is the default value.
    $sBasePath = $_SERVER['PHP_SELF'] ;
    $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
    
    $oFCKeditor = new FCKeditor('FCKeditor1') ;
    $oFCKeditor->BasePath = $sBasePath ;
    $oFCKeditor->Value = $res['campo'];
    $oFCKeditor->Create() ;
    ?>

  3. #3
    grazie funziona...
    sei un mito...

    ti devo un caffè

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.