lqdmindz Posted July 16, 2010 Share Posted July 16, 2010 Hi guys, i currently have a page in my phpbb that has the CKEditor on it. Below is the editor.php <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); if ($user->data['user_id'] == ANONYMOUS) { login_box('', $user->lang['LOGIN']); } page_header('Editor'); $template->set_filenames(array( 'body' => 'editor.html', )); make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); ?> And here is the HTML page editor.html <!-- INCLUDE overall_header.html --> <script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <textarea name="text1"></textarea> <script type="text/javascript"> CKEDITOR.replace( 'text1' ); </script> <!-- INCLUDE jumpbox.html --> <!-- INCLUDE overall_footer.html --> I would like to submit the info from the textarea to a file called announce.txt. Could anyone help me out with this? Link to comment https://forums.phpfreaks.com/topic/207921-posting-info-from-ckeditor-to-txt-file/ Share on other sites More sharing options...
AbraCadaver Posted July 16, 2010 Share Posted July 16, 2010 Well you're going to need to put a form with a submit button around that text area, with method="post' and action="save.php". Then in save.php, something like: file_put_contents('announce.txt', $_POST['text1']); Link to comment https://forums.phpfreaks.com/topic/207921-posting-info-from-ckeditor-to-txt-file/#findComment-1087121 Share on other sites More sharing options...
lqdmindz Posted July 16, 2010 Author Share Posted July 16, 2010 Thanks for that. Prior to reading this i managed to work out the form part. It all works well now. But my output file save.php is quite plain. How would i wrap it in PHPBB headers and footers? Link to comment https://forums.phpfreaks.com/topic/207921-posting-info-from-ckeditor-to-txt-file/#findComment-1087260 Share on other sites More sharing options...
AbraCadaver Posted July 17, 2010 Share Posted July 17, 2010 Thanks for that. Prior to reading this i managed to work out the form part. It all works well now. But my output file save.php is quite plain. How would i wrap it in PHPBB headers and footers? I wouldn't. I would have a redirect after the file save that redirected them back to a certain page. Link to comment https://forums.phpfreaks.com/topic/207921-posting-info-from-ckeditor-to-txt-file/#findComment-1087316 Share on other sites More sharing options...
lqdmindz Posted July 18, 2010 Author Share Posted July 18, 2010 I think phpbb does have that....just have to find out how to use it. Link to comment https://forums.phpfreaks.com/topic/207921-posting-info-from-ckeditor-to-txt-file/#findComment-1087700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.