Jump to content
MakeWebGames

Recommended Posts

Posted
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

  • 3 months later...
  • 2 weeks later...
Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...