Ckeditor - How do I "save" to the web page I am editing? -


php version 5.3.3-1 ubuntu 10.10 apache 2.2

ckeditor 3.6.1

i can edit , save web page editing not update ? edited text appears in new window. want web page editing updated.

ckeditor.js, test.html , posteddata.php in same directory /var/www/

test.html

< head>   < title>test page < /title >   < meta http-equiv="content-type" content="text/html; charset=utf-8"/ >   < script type="text/javascript" src="ckeditor.js">< /script > < /head > < body > < form action="posteddata.php" method="post" > < textarea id="editor1" name="editor1" > &lt;p&gt;your text goes here&lt;/p&gt; < /textarea> < script type="text/javascript" > window.onload = function() {ckeditor.replace( 'editor1' );};  < /script> < input type="submit" value="submit"/ > < /form> < /body> < /html> 

posteddata.php

< ?php if ( isset( $_post ) ) $postarray = &$_post ;          // 4.1.0 or later, use $_post else $postarray = &$http_post_vars ; // prior 4.1.0, use http_post_vars foreach ( $postarray $sform => $value ) { if ( get_magic_quotes_gpc() )     $postedvalue = htmlspecialchars( stripslashes( $value ) ) ; else     $postedvalue = htmlspecialchars( $value ) ; ?>     < tr>         < th style="vertical-align: top"><?php echo htmlspecialchars($sform); ?> < /th>         < td><pre class="samples"><?php echo $postedvalue?></pre></td>     < /tr>    < ?php } ?>   

all code print out you've typed in. doesn't save anywhere.

probably simplest way store changes in database , load them each time.

here's tutorial; worth reading if want useful in php: http://www.w3schools.com/php/php_mysql_intro.asp


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -