Re: Re: A beginner´s question
| From: | Micah Gersten | Date: | Mon, 05 Jan 2009 03:39:40 +0000 |
| Subject: | Re: Re: A beginner´s question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-285448@lists.php.net to get a copy of this message | ||
Micah Gersten wrote:
> Nathan Rixham wrote:
>
>> Eduardo wrote:
>>
>>> Hi, I am Eduardo, a new PHP programmer and an old Cobol veteran.
>>> I know that
>>> $tastes=$_POST["tastes"]; moves the content of "tastes" from
>>> <p><textarea rows="5" name="tastes"
>>> cols="28"></textarea></p>
>>> to
>>> $tastes
>>>
>>>
>>> How do I move the content of $tastes to X of
>>> echo "<textarea rows="5" cols="28" readonly
>>> name=X>\n";
>>> ?
>>>
>>> Thanks, Eduardo
>>>
>>>
>> echo "<textarea rows="5" cols="28" readonly name=" .
>> $tastes . ">\n";
>>
>> echo "this is how you echo a " . $variable . " in a string";
>>
>>
>
> While that is true, that's probably not what the OP wants.
> He's probably looking for:
> echo "<textarea rows="5" cols="28" readonly
> name="tastes">$tastes</textarea>\n";
>
> Thank you,
> Micah Gersten
>
>
As Vicente pointed out, there was a problem with what I posted, so
here's the fixed version:
echo '<textarea rows="5" cols="28" readonly
name="tastes">',$tastes,"</textarea>\n";
Explanation:
Single quotes save from backslashing the quotes.
Commas save the concatenation overhead.
Quotes around the last block since it uses \n which needs doublw quotes to output.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com