• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

help with htmlspecialchars

mlowery

New Member
I am creating a form processor. When the form is submitted, then information is stored into a MySQL database. I am using the php function htmlspecialchars whenever I submit the form information into the database (in case someone's name is O'Reilly or something, the apostraphe will not mess with the MySQL syntax).

Originally, the problem was just that in MySQL there is a 255 character limit per cell. When htmlspecialchars converts the text, there are four times as many characters stored into the cell. This is fine, except I have a textarea titled "information" where people can type paragraphs of information.
If possible, I would like to find an alternative so that people can type more than 255 characters in the textarea.

This is a link to the form ([url]www.mlowery.net/se/contact2.php)[/URL]

This is a link to a .txt version of the php script ([url]http://mlowery.net/se/contact_processor.txt)[/URL]
 
Use the text? If by that you mean don't use htmlspecialchars, then that's not possible. If someone wants to contact me and their name is John O'Reilly, the apostraphe in O'Reilly will mess up my entire database script (that I use to display the form submissions).
If I didn't want to limit the text to 255 chars, how would I go about storing the Information and displaying it along with its co-parts (the name, email, country, etc. . .)?
 
Thanks a lot guys, no problem spec. I appreciate whatever help I can get :) Thanks a lot CareBear, it worked. For some reason, through the dozens of MySQL tutorials that I've read, I never figured out what each of the column typed did.
Thanks again :classic2:,
Mitch
 
A little more help...

Hi! I've got a mySQL database that logs all of my music from Winamp. However, none of the albums, artists, or titles that have a ' in the title will display correctly. Please take a look at the following page and you will see what I mean:

http://music.net-hub.com/browse.php?action=first&letter=G

Guns N' Roses is on that list, but when I write the hyperlink out, it cuts everything off after the '. Any ideas? Thanks in advance!

Ronnie
 
Back
Top