Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2010
    Messaggi
    6

    load \ save file html con tinymce

    Ciao a tutti!

    ho un problema grossissimo, con il seguente codice carico tinymce in una pagina

    codice:
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <style type="text/css">
    <!--
    .a{
    width:300px;
    height:80px;
    }
    -->
    </style>
    
    
    <title>Untitled Page</title>
       
        <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce_src.js"></script>
        <script type="text/javascript">
        tinyMCE.init({
            mode : "textareas",
            theme : "advanced",
            plugins : "fullpage",
            theme_advanced_button3_add : "fullpage"
        });
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head>
    <body>
    
    
    
    
      <textarea class="a"></textarea>
    </p>
    
    
    
      <input type="submit" name="Submit" value="Salva modifiche">
    </p>
    
    
    </p>
    </body>
    
    </html>
    ma però deve mostrare di default il testo contenuto in prova.txt (oppure prova.html) e con il tasto salva va a salvare sempre in prova.txt (oppure prova.html) le modifiche effettuate...

    è possibile? come?

    ringrazio in anticipo.

    ira

  2. #2
    si e vero lo stesso problema celo pure io se qualche utente esperto di php volesse darci una mano perfavore

  3. #3
    Utente di HTML.it L'avatar di garakkio
    Registrato dal
    Dec 2011
    residenza
    Roma
    Messaggi
    480
    tinymce serve solo per "abbellire" un'interfaccia, è completamente lato client (è scritto in javascript)
    La logica per salvare un contenuto invece è lato server (quella che devi scrivere in PHP).
    Ergo: prima devi implementare la tua logica di salvataggio di un contenuto in PHP, dopo ci puoi mettere sopra tinymce.

  4. #4
    tinymce serve solo per "abbellire" un'interfaccia, è completamente lato client (è scritto in javascript)
    La logica per salvare un contenuto invece è lato server (quella che devi scrivere in PHP).
    Ergo: prima devi implementare la tua logica di salvataggio di un contenuto in PHP, dopo ci puoi mettere sopra tinymce.


    si infatti io po di php lo mastico ma non sono un esperto sono riuscito a creare un interfaccia che salva la pagina in html ma con nome preimpostato mentre vorrei riuuscire a
    creare un interfaccia tipo questa-> "http://aspnet.html.it/articoli/leggi/3012/utilizzare-editor-javascript-con-aspnet-tinymce/4/" che e scritta in asp.net,
    che pultroppo su server linux non potrà mai funzionare, quindi mi chiedo se ci sia un utente esperto di php su html.it che sappia come realizare un interfaccia che consenta il carricamento e il salvataggio direttamente nella textarea di tinymce, e se la cosa sia possibile naturalmente, in seguito posto il mio script in modo da rendere cio che sono riuscito a fare e dove mi sono bloccato

    pagina index.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Full featured example</title>


    <script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
    tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    plugins : "safari,pagebreak,style,layer,table,save,advhr,adv image,advlink,emotions,iespell,inlinepopups,insert datetime,preview,media,searchreplace,print,context menu,paste,directionality,fullscreen,noneditable,v isualchars,nonbreaking,xhtmlxtras,template",

    // Theme options
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,striketh rough,|,justifyleft,justifycenter,justifyright,jus tifyfull,styleselect,formatselect,fontselect,fonts izeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,repla ce,|,bullist,numlist,|,outdent,indent,blockquote,| ,undo,redo,|,link,unlink,anchor,image,cleanup,help ,code,|,insertdate,inserttime,preview,|,forecolor, backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,s up,|,charmap,emotions,iespell,media,advhr,|,print, |,ltr,rtl,|,fullscreen",
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,s tyleprops,|,cite,abbr,acronym,del,ins,attribs,|,vi sualchars,nonbreaking,template,pagebreak",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,

    // Example content CSS (should be your site CSS)
    content_css : "css/content.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "lists/template_list.js",
    external_link_list_url : "lists/link_list.js",
    external_image_list_url : "lists/image_list.js",
    media_external_list_url : "lists/media_list.js",

    // Replace values for the template plugin
    template_replace_values : {
    username : "Some User",
    staffid : "991234"
    }
    });
    </script>


    </head>
    <body>

    <form method="post" action="pagina.php">


    <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
    &lt;p&gt;
    &lt;img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /&gt; TinyMCE is a platform independent web based Javascript HTML &lt;strong&gt;WYSIWYG&lt;/strong&gt; editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
    &lt;/p&gt;
    &lt;p&gt;
    We recommend &lt;a href="http://www.getfirefox.com" target="_blank"&gt;Firefox&lt;/a&gt; and &lt;a href="http://www.google.com" target="_blank"&gt;Google&lt;/a&gt; &lt;br /&gt;
    &lt;/p&gt;
    </textarea>

    <div>
    </div>




    </form>

    </body>
    </html>

    pagina.php

    <?php
    $nome_file = 'posta.html';
    $pre = '<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>'.$_POST['Titolo'].'</title>
    </head><body>';
    $post = '</body></html>';

    $h = fopen($nome_file, 'w');
    fwrite($h, $pre.$_POST['elm1'].$post);
    fclose($h);
    ?>

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 © 2025 vBulletin Solutions, Inc. All rights reserved.