OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Converting special characters in form input

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Converting special characters in form input
Page: [1]
 
womble

 

Posts: 6007
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
Converting special characters in form input - 10/13/2009 14:12:41   
I've got a number of forms on a site submitting information to a database, but when trying out the forms/database with some test data and validating my (X)HTML pages which display data pulled from the database, I realised the reason they weren't validating was because there were some "special characters" in the inputted data, such as "&".

Is there a way I can convert such special characters before they're entered into the database?

(BTW, the form's a PHP form, and the database is MySQL)

_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~
Giomanach

 

Posts: 6187
Joined: 11/19/2003
From: England
Status: offline

 
RE: Converting special characters in form input - 10/13/2009 19:06:05   
Depends. Do you want the convert them to HTML coding or replace them with something else that is then later turned into the original info posted from the form?

_____________________________




(in reply to womble)
womble

 

Posts: 6007
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
RE: Converting special characters in form input - 10/14/2009 5:54:26   
I'm not sure really. I'm not doing anything with the data other than displaying it (and potentially searching using that field), so I'm not sure. At the moment I've just got the bare bones of my app working (i.e. without any validation or security or anything, just to figure out the different components of getting it working.

_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~

(in reply to Giomanach)
Giomanach

 

Posts: 6187
Joined: 11/19/2003
From: England
Status: offline

 
RE: Converting special characters in form input - 10/14/2009 21:36:22   
Well, you can either validate the forms/data and ask for special characters to be removed before insertion to the database, or you can remove then, or you can replace them, or you can enter them as they are.

_____________________________




(in reply to womble)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Converting special characters in form input
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts