Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-28-2010, 08:54 AM   PM User | #1
badHabitZ
New Coder

 
Join Date: Jun 2010
Posts: 68
Thanks: 9
Thanked 0 Times in 0 Posts
badHabitZ is an unknown quantity at this point
htmlspecialchars and so on..

Hey guys,

Just a simple question maybe. I'm using a news system on my website which I've made myself, but the news does not enter into the database when using any special character like below:

Code:
~ or ` or ' or "
I've tried using the following but it still does not work:

PHP Code:
$news htmlspecialchars(htmlentities(stripslashes(trim($_POST['news'])))); 
Anyone knows the right way to use this so I can still use the "special characters"? :P

Thanks in advance!
badHabitZ is offline   Reply With Quote
Old 11-28-2010, 09:09 AM   PM User | #2
MattF
Senior Coder

 
Join Date: Jul 2009
Location: South Yorkshire, England
Posts: 2,322
Thanks: 6
Thanked 304 Times in 303 Posts
MattF will become famous soon enoughMattF will become famous soon enough
Assuming MySQL, mysql_real_escape_string().
MattF is offline   Reply With Quote
Users who have thanked MattF for this post:
badHabitZ (11-28-2010)
Old 11-28-2010, 10:27 AM   PM User | #3
badHabitZ
New Coder

 
Join Date: Jun 2010
Posts: 68
Thanks: 9
Thanked 0 Times in 0 Posts
badHabitZ is an unknown quantity at this point
Thanks, that worked
badHabitZ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:18 AM.


Advertisement
Log in to turn off these ads.