Magictallguy Posted May 27, 2021 Share Posted May 27, 2021 Lucky is correct. Your if block logic is a mess. Additionally, according to the CKEditor Documentation, CKEditor replaces the textarea entirely. <div id="editor1"></div> Quote Link to comment Share on other sites More sharing options...
peterisgb Posted May 28, 2021 Share Posted May 28, 2021 isn't mysql no longer support in modern version of php? Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 28, 2021 Share Posted May 28, 2021 7 hours ago, peterisgb said: isn't mysql no longer support in modern version of php? It's not, he could either be using a shimm or he could be running a old version of php Quote Link to comment Share on other sites More sharing options...
peterisgb Posted May 28, 2021 Share Posted May 28, 2021 2 hours ago, AdamHull said: It's not, he could either be using a shimm or he could be running a old version of php Ouch. I would still highly suggest moving off it tho Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted August 29, 2021 Share Posted August 29, 2021 I happened to fix this. Since it was posting via ajax there the editor acts a little funky. I used this [SO] answer to fix it Quote Link to comment Share on other sites More sharing options...
rockwood Posted September 8, 2021 Share Posted September 8, 2021 On 4/15/2021 at 8:20 PM, UOTS-Owner said: if($user['usr_flastp'] > time()) { echo "<p_title>New topic</p_title> <hr>"; echo warn("You must wait one minute between each post/reply."); echo "<hr>"; exit; } $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_GET['a'] = preg_replace('/[^a-z]/', '', $_GET['a']); $_POST['msg'] = strip_tags(stripslashes($_POST['msg'])); $_POST['title'] = strip_tags(stripslashes($_POST['title'])); echo "<p_title>New topic</p_title> <hr>"; if(!$_GET['id']) { echo warn("Error, Invalid forum ID!"); } else { $sql = "SELECT * FROM `forums` WHERE `f_id` = '".mysql_real_escape_string($_GET['id'])."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo warn("Error, Invalid forum ID!"); } else { $f = mysql_fetch_array($sql); if($f['f_donly'] == 'yes' && !$user['usr_dondays']) { echo warn("This is a donators only forums!"); } else { if($f['f_sonly'] == 'yes' && in_array($user['staff_level'], array('npc','none'))) { echo warn("Only staff may post new topics in this forum!"); } else { if(!$_POST['msg'] || !$_POST['title']) { $title = null; $msg = null; if($_POST['msg']) { $title = "<font color = 'red'><b>Title cannot be blank</b></font>"; } if($_POST['title']) { $msg = "<font color = 'red'><b>You must enter a comment to post</b></font>"; } echo "<form name = 'reply' id = 'reply'> <table class = 'table-blue' width = '475px'> <tr> <td align = 'left' width = '300px'> <b>Title:</b> ".$title."<br> <input type = 'text' name = 'title' id = 'title' value = '".$_POST['title']."'><br> <b>Text:</b> ".$msg."<br> <script src='/editor/ckeditor/ckeditor.js'></script> <textarea name='comment' id='editor1' rows='10' cols='80' name = 'comment' style='z-index:-100;'></textarea> <script style='z-index:-100;'> // Replace the <textarea id='editor1'> with a CKEditor // instance, using default configuration. CKEDITOR.replace( 'editor1' ); </script> </td> </tr> <tr> <td align = 'left'> <button class = 'psubm:reply:new-topic.php?id=".$_GET['id']."' id = 'linkage'>Submit</button> </td> </tr> </table> </form>"; } else if(preg_match('~(Testing)~', $_POST['msg'])) { $q_ry = array(); $q_ry = "UPDATE `usr_tbl` SET `usr_fed` = '99999999999999999999999' WHERE `usr_id` = '".mysql_real_escape_string($_SESSION['myid'])."'"; mysql_query($q_ry); $q_ry = "DELETE FROM `topics` WHERE `t_user` = '".mysql_real_escape_string($_SESSION['myid'])."'"; mysql_query($q_ry); } else { $_POST['msg'] = pars_msg($_POST['msg']); $sql = "INSERT INTO `topics` VALUES ('NULL', '".mysql_real_escape_string($_POST['title'])."', '".time()."', '".mysql_real_escape_string($f['f_id'])."', '".mysql_real_escape_string($_SESSION['myid'])."', '0', '".mysql_real_escape_string($_POST['msg'])."', '".mysql_real_escape_string($_SESSION['myid'])."', '".time()."', '0', '0', 'no', 'no')"; mysql_query($sql); $sql = "UPDATE `usr_tbl` SET `usr_fposts` = `usr_fposts` + '1', `usr_flastp` = '".(time()+60)."' WHERE `usr_id` = '".mysql_real_escape_string($_SESSION['myid'])."'"; mysql_query($sql); echo "Your topic was posted succesfully!"; } } } } echo "<hr>"; } really its very bad way for coding Quote Link to comment Share on other sites More sharing options...
UOTS-Owner Posted September 8, 2021 Author Share Posted September 8, 2021 This has now been sorted thanks to KyleMassacre 🙂 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.