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 6677581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:08:21+00:00 2026-05-26T04:08:21+00:00

I accept data from TinyMCE. I get into difficulties when I copy and paste

  • 0

I accept data from TinyMCE. I get into difficulties when I copy and paste from a site such as this:

http://www.rlslog.net/category/games/pc/

I use the following functions to prevent an SQL injection and escape special characters that if ruin my whole page once I output the inserted text.

$title = mysql_real_escape_string($title);
$data = mysql_real_escape_string($data);
$author= mysql_real_escape_string($author);

$data =htmlentities($data);
$title =htmlentities($title);   
$author =htmlentities($author); 

mysql_query("SET NAMES 'utf8'");

mysql_query("INSERT INTO `easy_db`.`article` (`Title`,  `Article`, `Topics`, `author`, `page`, tpage ) VALUES('$title', '$data', '$topic', '$author', '$page','$tpage')")  or die(mysql_error());
mysql_close();

What I get when I output the data is my html text (which isnt the output from the database) looking like that:

כותרת היו×

I turend magic_quotes_gpc off in my php.ini

magic_quotes_gpc
Default Value: Off
Development Value: Off
Production Value: Off

Here is how the text that I put looks like when refering to it in phpmyadmin:

skidrow%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=35\" frameborder=\"0\" scrolling=\"no\"></iframe></p>\r\n<p class=\"comments_link\" style=\"padding-top: 20px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; line-height: 19px; margin: 0px;\"><a style=\"color:

c02e13; text-decoration: none; padding: 0px; margin: 0px;\" title=\"Comment on Orcs Must Die Fix-SKIDROW\"
href=\"http://www.rlslog.net/orcs-must-die-fix-skidrow/#respond\">Comments(0)</a></p>\r\n</div>\r\n</div>\r\n<div style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 40px; margin: 0px;\"><iframe style=\"padding: 0px; margin: 0px;\" src=\"http://www.roadcomponentsdb.com/300.htm\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"NO\" width=\"300\" height=\"250\"></iframe></div>\r\n<p id=\"nextlinks\" style=\"padding-top: 20px; padding-right: 20px; padding-bottom: 0px; padding-left: 20px; margin: 0px;\"><strong style=\"padding: 0px; margin: 0px;\">Previous post:</strong>&nbsp;<a style=\"color: #c02e13; text-decoration: none; padding: 0px; margin: 0px;\" href=\"http://www.rlslog.net/musclemag-international-%e2%80%93-december-2011-p2p/\">MuscleMag International &ndash; December 2011-P2P</a></p>

The question is why is it happening? how do I prevent it? and do I do enough to prevent an sql injection?

  • 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-26T04:08:22+00:00Added an answer on May 26, 2026 at 4:08 am

    SET NAMES 'utf8' is altering your data.

    Take a look at this MySQL forum link. He provides a fairly good description of what’s going on. Short description: the conversion process is confused as to what it should be reading the characters as.

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

Sidebar

Related Questions

How can you get MSSQL server to accept Unicode data by default into a
I'm trying to set up jsTree to dynamically accept JSON data from django. This
I try to get data from server http://someserver12345.com If i download it for example
I am told TFS can accept data on build/test metrics from 3rd party continuous
I want to accept a url like this one www.mysite.com/1-2,3 and turn it one
I've been trying to Base64 encode image data from the user (in this case
I'm using NHibernate with Burrow and Fluent to shuttle data from SQLServer2005 into a
I'm working on an application that needs to accept posted data from a form
I am making a simple program which suppose to accept txt file data from
I'm pulling in data from a flat file into a SQL Server 2008 table.

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.