Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7415133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:14:21+00:00 2026-05-29T07:14:21+00:00

Okay, so when I run this script to remove a user’s comment from a

  • 0

Okay, so when I run this script to remove a user’s comment from a forum post, the $_SESSION[‘id’] (user’s mysql id) changes to the $postid (the id of the forum post). I am not calling any function to set it, and I have session_write_close(); called when the session is initialized.

<?php
session_start();

// I'm not showing connection code.
if(isset($_SESSION['user'])){

    $user = mysql_real_escape_string($_SESSION['user']);
    $userid = mysql_real_escape_string($_SESSION['id']);

    $id = mysql_real_escape_string($_GET['id']);
    $postid = mysql_real_escape_string($_GET['article']);

    $result = mysql_query("DELETE FROM `______`.`______` WHERE `userid`='$userid' AND `id`='$id' AND `user`='$user'")or die(mysql_error());

    if(mysql_affected_rows($result) == 1){

          mysql_query("UPDATE `_______`.`______` SET `points`=`points`-'1' WHERE `id`='$userid' AND `username`='$user'")or die(mysql_error());
          mysql_query("INSERT INTO `________`.`_______` (`user`,`userid`,`amount`,`reason`) VALUES('$user', '$userid', '-1', 'Removed a comment')")or die(mysql_error());

    }

    mysql_close($con);

    ob_start();
    header("location:../view-article?id=$postid");
    ob_end_flush();

} //if there is a user
else {

    ob_start();
    header("location:http://boundsblazer.com/not-logged-in?url=articles.view-article:id=$postid");
    ob_end_flush();
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:14:23+00:00Added an answer on May 29, 2026 at 7:14 am

    If register_globals is on, this line

    $id = mysql_real_escape_string($_GET['id']);
    

    possibly change the value of $_SESSION['id']. So please try again with register_globals off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I'm completely new to this. I created a python script that imports tkinter
Okay this is my first post here so please forgive me if i mess
Is it okay to run Hibernate applications configured with hbm2ddl.auto=update to update the database
okay i have found the way to run a video in a image.... the
Okay so I'm trying to make a little gag program that will run away
Okay so im working on this php image upload system but for some reason
Okay, so this probably sounds terribly nefarious, but I need such capabilities for my
Okay I am newer to python and have been researching this problem but I
Update: I wrote a working script that finishes this job in a reasonable length
Okay, this is the problem: I am getting this error message when I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.