Textarea, and textfield problems
Posted: Thu Dec 10, 2009 12:46 pm
Its funny the problem i am encountering.
When i send a text into the database by using the text or textarea form element, i then try to retrieve that text back and place it into that same textfield or textarea, i encounter problems.
To explain the problem in a shorter way, assuming i have a text value stored in a variable as shown below, and i want to place that text value inside a textarea or a textfield i will encounter problems as shown below:
$value='We said "We are going there" yesterday';
$value1="We weren't supposed to go there"
It will appear cut if i tried to retrieve these texts and place them back in the textfield or textarea.
I know its because i tried to echo everything out i.e.
echo "<input type='text' name='textfield' value='".$value."'/>";
echo '<input type="text" name="textfield" value="'.$value1.'"/>';
They will not show the textfield containing the full text as the text will be truncated.
I have tried all means to find a solution to this problem and it just doesnt seem to work.
This certainly can pose some security threat esp when a user does some registration using a username that contains even the (`) character. pls can someone help me solve this problem by telling me what to do?
When i send a text into the database by using the text or textarea form element, i then try to retrieve that text back and place it into that same textfield or textarea, i encounter problems.
To explain the problem in a shorter way, assuming i have a text value stored in a variable as shown below, and i want to place that text value inside a textarea or a textfield i will encounter problems as shown below:
$value='We said "We are going there" yesterday';
$value1="We weren't supposed to go there"
It will appear cut if i tried to retrieve these texts and place them back in the textfield or textarea.
I know its because i tried to echo everything out i.e.
echo "<input type='text' name='textfield' value='".$value."'/>";
echo '<input type="text" name="textfield" value="'.$value1.'"/>';
They will not show the textfield containing the full text as the text will be truncated.
I have tried all means to find a solution to this problem and it just doesnt seem to work.
This certainly can pose some security threat esp when a user does some registration using a username that contains even the (`) character. pls can someone help me solve this problem by telling me what to do?