Problems with apostrophes and form fields

This is a discussion on Problems with apostrophes and form fields within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi yall I have the following problem A user inputs something like Mark's Birthday into the database through a ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-29-2005
oi
 
Posts: n/a
Default Problems with apostrophes and form fields

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

Mark


Reply With Quote
  #2 (permalink)  
Old 09-29-2005
Shawn Wilson
 
Posts: n/a
Default Re: Problems with apostrophes and form fields

"oi" <o@fhfdjh.df> wrote in message
news:1127993456.ed032b186235bd5d92aceed97880bf70@t eranews...
> 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


Reply With Quote
  #3 (permalink)  
Old 09-29-2005
oi
 
Posts: n/a
Default Re: Problems with apostrophes and form fields

Hi Shawn

Yes the data was going in properly

It was the quotes issue as you mentioned...

Thanks for your help

Mark


"Shawn Wilson" <shawnw_nospam_@_nospam_dvigroup.net> wrote in message
news:y0S_e.8432$Wl6.2338@fe05.news.easynews.com...
> "oi" <o@fhfdjh.df> wrote in message
> news:1127993456.ed032b186235bd5d92aceed97880bf70@t eranews...
>> 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
>



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:59 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0