short text strings with apostrophes and forms

short text strings with apostrophes and forms

am 20.04.2006 17:56:25 von jeffreyb

I have an application which calls up some data from a MySQL table and
puts it into a web form for users to modify.

One of the cells holds a text string which is put into a text input
field. However, if that text string includes an apostrophe, all text
after the apostrophe disappears.

For example, if the test string from a database cell reads...

Fix the managers' cars by Tuesday

and that is saved in the variable $some_text, which is called up in a
form...



The text field on the web page will only contain...

Fix the managers

How can I get the text field to show the entire string?

Many thanks,

Jeffrey

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: short text strings with apostrophes and forms

am 20.04.2006 18:06:41 von Charlie van de Kerkhof

Hi Jeffrey,

try this:
>>>
print " value='".htmlspecialchars($some_text)."'>\n";
<<<

Regards,
- Charlie

On 20 Apr 2006, at 17:56, Jeffrey wrote:
> I have an application which calls up some data from a MySQL table
> and puts it into a web form for users to modify.
> One of the cells holds a text string which is put into a text input
> field. However, if that text string includes an apostrophe, all
> text after the apostrophe disappears.
> For example, if the test string from a database cell reads...
> Fix the managers' cars by Tuesday
> and that is saved in the variable $some_text, which is called up in
> a form...
>
> The text field on the web page will only contain...
> Fix the managers
> How can I get the text field to show the entire string?
> Many thanks,
> Jeffrey

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: short text strings with apostrophes and forms

am 20.04.2006 18:07:44 von Richard Leclair

------=_NextPart_000_000B_01C664D7.9E29E5D0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

You could try enclosing the string in the HTML line by double-quotes rather
than single quotes.



Ie.



Regards,
Richie !



_____

From: Jeffrey [mailto:jeffreyb@ungodly.com]
Sent: Thursday, 20 April 2006 11:56 pm
To: PHP DB
Subject: [PHP-DB] short text strings with apostrophes and forms



I have an application which calls up some data from a MySQL table and
puts it into a web form for users to modify.

One of the cells holds a text string which is put into a text input
field. However, if that text string includes an apostrophe, all text
after the apostrophe disappears.

For example, if the test string from a database cell reads...

Fix the managers' cars by Tuesday

and that is saved in the variable $some_text, which is called up in a
form...



The text field on the web page will only contain...

Fix the managers

How can I get the text field to show the entire string?

Many thanks,

Jeffrey

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





_____

avast! Antivirus : Inbound message clean.


Virus Database (VPS): 0616-3, 20/04/2006
Tested on: 21/04/2006 12:03:14 am
avast! - copyright (c) 1988-2005 ALWIL Software.



------=_NextPart_000_000B_01C664D7.9E29E5D0--

Re: short text strings with apostrophes and forms

am 20.04.2006 18:21:05 von Luis M Morales C

Jeffry,

I suggest use htmlentities/html_entity_decode functions. For example to
update the db with values use:

$myCol = htmlentities($mycol_value);

Ej: query

$query = "update my_table set myCol='{$myCol}' where id = 'id_val'";

Now when your application restore the data from the db you can use:

$mycol_value = html_entity_decode ($myCol);


$mycol_value: is the value from html form
$myCol: is the name of your colum's table to update in your query.

Good luck,

Regards,

Luis Morales


On Thu, 2006-04-20 at 17:56 +0200, Jeffrey wrote:
> I have an application which calls up some data from a MySQL table and
> puts it into a web form for users to modify.
>
> One of the cells holds a text string which is put into a text input
> field. However, if that text string includes an apostrophe, all text
> after the apostrophe disappears.
>
> For example, if the test string from a database cell reads...
>
> Fix the managers' cars by Tuesday
>
> and that is saved in the variable $some_text, which is called up in a
> form...
>
>
>
> The text field on the web page will only contain...
>
> Fix the managers
>
> How can I get the text field to show the entire string?
>
> Many thanks,
>
> Jeffrey
>
--
------------------------------------------------------------ ---------------------
Luis Morales
Consultor de Tecnologia
Cel: +(58)416-4242091
------------------------------------------------------------ ---------------------
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
------------------------------------------------------------ ---------------------

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: short text strings with apostrophes and forms

am 20.04.2006 18:26:39 von dpgirago

> I have an application which calls up some data from a MySQL table and
> puts it into a web form for users to modify.
>
> One of the cells holds a text string which is put into a text input
> field. However, if that text string includes an apostrophe, all text
> after the apostrophe disappears.
>
> For example, if the test string from a database cell reads...
>
> Fix the managers' cars by Tuesday
>
> and that is saved in the variable $some_text, which is called up in a
> form...
>
>
>
> The text field on the web page will only contain...
>
> Fix the managers
>
> How can I get the text field to show the entire string?
>
> Many thanks,
>
> Jeffrey


htmlentities($some_text, ENT_QUOTES) is more robust than htmlspecialchars
();

David

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: short text strings with apostrophes and forms

am 20.04.2006 21:45:58 von jeffreyb

dpgirago@mdanderson.org wrote:
>>I have an application which calls up some data from a MySQL table and
>>puts it into a web form for users to modify.
>>
>>One of the cells holds a text string which is put into a text input
>>field. However, if that text string includes an apostrophe, all text
>>after the apostrophe disappears.
>>
>>For example, if the test string from a database cell reads...
>>
>>Fix the managers' cars by Tuesday
>>
>>and that is saved in the variable $some_text, which is called up in a
>>form...
>>
>>
>>
>>The text field on the web page will only contain...
>>
>>Fix the managers
>>
>>How can I get the text field to show the entire string?
>>
>>Many thanks,
>>
>>Jeffrey
>
>
>
> htmlentities($some_text, ENT_QUOTES) is more robust than htmlspecialchars
> ();
>
> David
>
>
Thanks, David. That did the trick. And thanks to everyone else who
quickly responded with intelligent advice!

Jeffrey

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php