Reply to Re: Problems with apostrophes and form fields

Your name:

Reply:


Posted by Shawn Wilson on 09/29/05 16:31

"oi" <o@fhfdjh.df> wrote in message
news:1127993456.ed032b186235bd5d92aceed97880bf70@teranews...
> Hi yall
>
> I have the following problem
>
> A user inputs something like
>
> Mark's Birthday
>
> into the database through a form. This works OK
>
> However, when the data is re-presented in a form, everything after the
> apostrophe is cut off...
>
> How can I get all of the data back into the form?
>
> TIA
>

Need to know a couple things...

1. Confirm that the entire piece of data is making it to the DB. Is the
database really holding [Mark's Birthday]? Does 'this works OK' really mean
it worked or that you just didn't get any errors?

2. Assuming the whole thing made it to the DB, then view the source of your
HTML when the form is rendered with missing characters. Do you see this:
<input type='text' name='name' value='Mark's Birthday'> ?

If that's all it is, then your issue is the single quotes. Change your
[value=] property to use double quotes. If you're drawing this via PHP code
then you can do this: value=\"$var\" so the quotes don't trip you up.
You'll end up with value="Mark's Birthday" which will work fine.

I see that happen most often, so we'll start there.


--
Shawn Wilson

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация