I have a gardening pictures site where I enter info into a form such as:
common_name, description and an image. The image is renamed to ['common_name']large.jpg then copied, the copy renamed to ['common_name']small.jpg and made into a thumbnail.
Everything works brilliantly, images stored in a folder, the correct things entered into the databse.
Viewing the pictures involves a preview using the image_small.jpg. Then if you want full details, click a 'view' link and see the picture in its full glory. Everything works perfectly...
Except in Internet Explorer (surprise, surprise!). So, to the problem:
If the common_name has a ' in it, such as Iris 'Harmony', the image is named as:
Iris \ 'Harmony\ '._large.jpg (ignore the spaces, I can't post a \ next to a ' as it strips them)
Firefox, lynx, opera, epiphany, mozilla, etc handle that just fine and show the images prefectly.
Naturally, IE can't show the image as it has a \ in it!
Not having ' in the name is not an option. Not having the image renamed to the common_name is not an option due to my customer's requirements.
So how do I enter data into the database with a ' in the data and no slashes?
It won't enter the data because it has a ' in it. If I escape the ' with a \, then IE won't display the image.
Um, any ideas? I've tried everything I can think of and can find after 2 hours of searching mysql, php.net and here.
In summary, how to enter data into mysql with a ' in the data, without a \ as IE can't display the image with a \ in it?