Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    68
    Thanks
    9
    Thanked 0 Times in 0 Posts

    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!

  • #2
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Assuming MySQL, mysql_real_escape_string().

  • Users who have thanked MattF for this post:

    badHabitZ (11-28-2010)

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    68
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks, that worked


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •