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

  • Home
  • SEARCH
  • 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 8532305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:41:08+00:00 2026-06-11T09:41:08+00:00

i have a form that users post about themselves exc. I’ve read that with

  • 0

i have a form that users post about themselves exc. I’ve read that with PDO you don’t get any issues with apostrophes or quatation marks, however i’m getting " as \" exc. as you can guess.

Also tried to read about http://www.php.net/manual/en/pdo.prepared-statements.php but this part of website is not working as i see that’s why i ask here first.

I get user input like this :

if(isset($_POST["doit"])) {
    $about = cleanInput($_POST["about"]);
    $name = cleanInput($_POST["name"]);

    if(!empty($about) && !empty($name)){
     try{
     $cu_query = "INSERT INTO `members` (`about`, `name`) VALUES (:about, :name)";
     $cu_query_do = $db->prepare($cu_query);
     $cu_query_do -> bindParam(':about', $about, PDO::PARAM_STR);
     $cu_query_do -> bindParam(':name', $name, PDO::PARAM_STR);
     $cu_query_do->execute() or die(print_r($cu_query_do->errorInfo(), true));
   }

     catch(PDOException $e) {
     $log->logError($e." - ".basename(__FILE__));
   }

   }
}

I print out user input like this and fetch the user inputs from db like this :

    //if isset get exc..

    try {
 $mq = "SELECT * FROM `members` WHERE `m_id` = :m_id";
 $mq_check = $db->prepare($mq);
 $mq_check->bindParam(':m_id', $m_id, PDO::PARAM_INT);
 $mq_check->execute();
 $ac = $db->query("SELECT FOUND_ROWS()")->fetchColumn();
 }
     catch(PDOException $e) {
 $log->logError($e." - ".basename(__FILE__));
                }


     if(!empty($ac)) {
     $_loader = true;
     $fetch = $mq_check->fetch (PDO::FETCH_ASSOC);
     $name = cleanInput($fetch['name']);
     $about = cleanInput($fetch['about']);


     }

     echo $name;

Thank You

Answer : If you’ve disabled the it from the WHM or from php.ini exc but if the problem still continues check with the code @Wayne Whitty mentioned below
If it is still seems like active ,

Than include this code in your header file :

if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
    foreach ($val as $k => $v) {
        unset($process[$key][$k]);
        if (is_array($v)) {
            $process[$key][stripslashes($k)] = $v;
            $process[] = &$process[$key][stripslashes($k)];
        } else {
            $process[$key][stripslashes($k)] = stripslashes($v);
        }
    }
}
unset($process);
}

That fixed my problem but if problem still continues, than you have to check your input sanitizations exc.

  • 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-06-11T09:41:09+00:00Added an answer on June 11, 2026 at 9:41 am

    Either magic quotes are enabled on your server or your function cleanInput() is calling the function addslashes().

    Check to see if magic quotes are enabled by running this:

    if(get_magic_quotes_gpc()){
        echo 'Magic Quotes enabled... sigh!';
    }
    

    The PHP manual shows you how to deal with magic quotes:

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

Sidebar

Related Questions

On my site, I have a form that users fill out to become a
I have a dynamic form that users can add/delete sets of input fields. I
I have a form that allows users to enter a date of birth: ie:
Okay, next PHPExcel question. I have an HTML form that users fill out and
I have an admin form that lets users create entities that require an image.
I have a dynamic form that adds users to the site, made so you
Okay all, I have a form that I want users to fill out. When
I have a website form that collects url of users to store in a
(Using MySQL and PHP) I have a search form that will allow my users
I have an Organization model that has_many users through affiliations. And, in the form

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.