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? Quote Link to comment 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']); Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.