+ Post New Thread
Results 1 to 4 of 4
Coding Thread, special characters in html form in Coding and Web Development; Hi All, Sorry to keep posting but i am at a brick wall with a few things and could do ...
  1. #1

    Join Date
    Sep 2013
    Location
    Worcestershire
    Posts
    79
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Wink special characters in html form

    Hi All,
    Sorry to keep posting but i am at a brick wall with a few things and could do with some help

    i have a html contact form which users fill out.when they submit the form it gets sent as an email and also gets inputted into an SQL table. The problem i have is when ever people use special characters such as ' or " we get a syntax error. as soon as they remove this the form sends.

    How can i prevent this from happening?
    Any sort of validation that swaps the special characters for accepted ones?

    Thanks All

  2. #2

    unixman_again's Avatar
    Join Date
    Nov 2011
    Posts
    715
    Thank Post
    29
    Thanked 143 Times in 109 Posts
    Rep Power
    135
    If you've done your forrm with php, try filter_var to sanitise the user input. That's what I do.

  3. #3

    Join Date
    Sep 2013
    Location
    Worcestershire
    Posts
    79
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    The form itself is html but processed to email and Sql with php. Would I be better recreating the form in php ?

  4. #4

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,452
    Thank Post
    1,439
    Thanked 1,170 Times in 798 Posts
    Rep Power
    707
    Sorry if this comes across as condescending, but I really think you ought to read up on SQL Injection attacks and how to prevent them; if you're not sanitising the input, a savvy student could destroy your SQL DB!

    PHP: SQL Injection - Manual

SHARE:
+ Post New Thread

Similar Threads

  1. Problem with special characters in passwords
    By johnjs in forum Home Access Plus+
    Replies: 4
    Last Post: 8th July 2013, 01:57 PM
  2. Junk characters in SIMS html exports
    By robertsmyth in forum MIS Systems
    Replies: 0
    Last Post: 10th October 2008, 03:51 PM
  3. Chinese characters in Office 2003?
    By zag in forum Windows
    Replies: 15
    Last Post: 1st October 2008, 09:09 AM
  4. Network links in HTML for an intranet style doo-daa...
    By Joedetic in forum How do you do....it?
    Replies: 11
    Last Post: 23rd May 2007, 11:59 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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