Quotation marks in form input

This is a discussion on Quotation marks in form input within the PHP Language forums, part of the PHP Programming Forums category; I have a form which contains a field for "height". If someone places an entry such as: 5'...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-27-2006
Karl Groves
 
Posts: n/a
Default Quotation marks in form input

I have a form which contains a field for "height".

If someone places an entry such as: 5'6" the form seems like it completely
empties that value.

It does NOT do this on my machine, but does on the client's machine, which
leads me to believe it is something with their php configuration.

Any ideas on what this is (and how I can work around it?)

TIA

--
Karl Groves
www.karlcore.com
Reply With Quote
  #2 (permalink)  
Old 07-27-2006
PTM
 
Posts: n/a
Default Re: Quotation marks in form input

"Karl Groves" <karl@NOSPAMkarlcore.com> wrote in message
news:Xns980D87EE2332karlkarlcorecom@216.196.97.136 ...
>I have a form which contains a field for "height".
>
> If someone places an entry such as: 5'6" the form seems like it
> completely
> empties that value.
>
> It does NOT do this on my machine, but does on the client's machine, which
> leads me to believe it is something with their php configuration.
>
> Any ideas on what this is (and how I can work around it?)
>
> TIA
>
> --
> Karl Groves
> www.karlcore.com


Sounds like something to do with the 'magic quotes' setting in the php.ini
file.
Unfortunately I'm not sure what effect it will have on their other php
scripts if you change the setting on it.
Search for:

get_magic_quotes_gpc
get_magic_quotes_runtime
set_magic_quotes_runtime

on www.php.net.

Hope this helps.


Phil


Reply With Quote
  #3 (permalink)  
Old 07-28-2006
lorento
 
Posts: n/a
Default Re: Quotation marks in form input

Add addslashes() function.

e.g:

$var = addslashes ($_GET["var"])

--
http://www.groupvita.com
http://www.immersivelounge.com

Karl Groves wrote:
> I have a form which contains a field for "height".
>
> If someone places an entry such as: 5'6" the form seems like it completely
> empties that value.
>
> It does NOT do this on my machine, but does on the client's machine, which
> leads me to believe it is something with their php configuration.
>
> Any ideas on what this is (and how I can work around it?)
>
> TIA
>
> --
> Karl Groves
> www.karlcore.com


Reply With Quote
  #4 (permalink)  
Old 07-28-2006
Jerry Stuckle
 
Posts: n/a
Default Re: Quotation marks in form input

Karl Groves wrote:
> I have a form which contains a field for "height".
>
> If someone places an entry such as: 5'6" the form seems like it completely
> empties that value.
>
> It does NOT do this on my machine, but does on the client's machine, which
> leads me to believe it is something with their php configuration.
>
> Any ideas on what this is (and how I can work around it?)
>
> TIA
>


Hi, Karl,

Do you mean the data doesn't get passed to the script, or when it's
redisplayed the value doesn't get displayed? Or it isn't stored in the
database correctly?

If the latter, check out htmlentities(). That's its main purpose. It
changes " to &quot;, for example.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #5 (permalink)  
Old 07-28-2006
Karl Groves
 
Posts: n/a
Default Re: Quotation marks in form input

Jerry Stuckle <jstucklex@attglobal.net> wrote in
news:B8OdnTUrs-2Ym1fZnZ2dnUVZ_oidnZ2d@comcast.com:

> Karl Groves wrote:
>> I have a form which contains a field for "height".
>>
>> If someone places an entry such as: 5'6" the form seems like it
>> completely empties that value.
>>
>> It does NOT do this on my machine, but does on the client's machine,
>> which leads me to believe it is something with their php
>> configuration.
>>
>> Any ideas on what this is (and how I can work around it?)
>>
>> TIA
>>

>
> Hi, Karl,
>
> Do you mean the data doesn't get passed to the script, or when it's
> redisplayed the value doesn't get displayed? Or it isn't stored in
> the database correctly?
>
> If the latter, check out htmlentities(). That's its main purpose. It
> changes " to &quot;, for example.
>


I haven't done any debugging yet. I think it is a magic_quotes_gpc issue.
It *looks* like the entire entry is getting deleted if it contains a
quotation mark ("). If the entry in that field doesn't contain the
quotation mark, everything is fine.



--
Karl Groves
www.karlcore.com
Reply With Quote
  #6 (permalink)  
Old 07-28-2006
Jerry Stuckle
 
Posts: n/a
Default Re: Quotation marks in form input

Karl Groves wrote:
> Jerry Stuckle <jstucklex@attglobal.net> wrote in
> news:B8OdnTUrs-2Ym1fZnZ2dnUVZ_oidnZ2d@comcast.com:
>
>
>>Karl Groves wrote:
>>
>>>I have a form which contains a field for "height".
>>>
>>>If someone places an entry such as: 5'6" the form seems like it
>>>completely empties that value.
>>>
>>>It does NOT do this on my machine, but does on the client's machine,
>>>which leads me to believe it is something with their php
>>>configuration.
>>>
>>>Any ideas on what this is (and how I can work around it?)
>>>
>>>TIA
>>>

>>
>>Hi, Karl,
>>
>>Do you mean the data doesn't get passed to the script, or when it's
>>redisplayed the value doesn't get displayed? Or it isn't stored in
>>the database correctly?
>>
>>If the latter, check out htmlentities(). That's its main purpose. It
>>changes " to &quot;, for example.
>>

>
>
> I haven't done any debugging yet. I think it is a magic_quotes_gpc issue.
> It *looks* like the entire entry is getting deleted if it contains a
> quotation mark ("). If the entry in that field doesn't contain the
> quotation mark, everything is fine.
>
>
>


Do you use the Live HTTP Headers extension to Firefox? I've found it to
be invaluable in figuring out post problems.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #7 (permalink)  
Old 07-29-2006
Rik
 
Posts: n/a
Default Re: Quotation marks in form input

Jerry Stuckle wrote:
> Karl Groves wrote:
>> Jerry Stuckle <jstucklex@attglobal.net> wrote in
>> news:B8OdnTUrs-2Ym1fZnZ2dnUVZ_oidnZ2d@comcast.com:
>>
>>
>>> Karl Groves wrote:
>>>
>>>> I have a form which contains a field for "height".
>>>>
>>>> If someone places an entry such as: 5'6" the form seems like it
>>>> completely empties that value.
>>>>
>>>> It does NOT do this on my machine, but does on the client's
>>>> machine, which leads me to believe it is something with their php
>>>> configuration.
>>>>
>>>> Any ideas on what this is (and how I can work around it?)
>>>>
>>>> TIA
>>>>
>>>
>>> Hi, Karl,
>>>
>>> Do you mean the data doesn't get passed to the script, or when it's
>>> redisplayed the value doesn't get displayed? Or it isn't stored in
>>> the database correctly?
>>>
>>> If the latter, check out htmlentities(). That's its main purpose.
>>> It changes " to &quot;, for example.
>>>

>>
>>
>> I haven't done any debugging yet. I think it is a magic_quotes_gpc
>> issue. It *looks* like the entire entry is getting deleted if it
>> contains a quotation mark ("). If the entry in that field doesn't
>> contain the quotation mark, everything is fine.

> Do you use the Live HTTP Headers extension to Firefox? I've found it
> to be invaluable in figuring out post problems.


Or just print_r($_REQUEST) and check what's there. If that's OK (and it
usually is), check your code.

Posting quotation marks is (almost) never the problem, only the code that
deals with it. Without that specific code, we can guess all we want, posting
the specific piece of code that handles it can give you a much more usefull
answer.

Grtz,
--
Rik Wasmus


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 05:29 PM.


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