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" > <p>your text goes here</p> < /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
Post a Comment