Re: apply css font face to post command
| From: | JEFFRY KILLEN | Date: | Wed, 16 Aug 2023 14:16:42 +0000 |
| Subject: | Re: apply css font face to post command | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-328250@lists.php.net to get a copy of this message | ||
I do not remember the syntax for specifying a font that is downloaded
But what appears to be the case is that the result of the post is supposed to be assigned the css
rule
The following assumes there is a valid css class definition that can be referenced, that does
specifiy
the downloaded font
<?php
if($_POST['text']) { print "<p class'(css class def goes
here)'>"$_POST['text']"</p>"}
?>
> On Aug 16, 2023, at 4:21 AM, Ed Greenberg <edg@greenberg.org> wrote:
>
> It sounds like the OP is trying to format the text within an input field. This is not
> supported by the browser.
>
> On 8/16/2023 7:18:23 AM, william wrote:
>> On 8/15/2023 5:31 AM, e-letter wrote:
>>> Readers,
>>>
>>> A css file contains
>>>
>>> "
>>> @font-face {
>>> font-family:fontname;
>>> src:url('./font.ttf') format ('truetype');
>>> }
>>> "
>>>
>>> A php file contains:
>>>
>>> "
>>> <form action='file.php' method='post'>
>>> text: <input type='text' name='text'>
>>> <input type='submit'>
>>> </form>
>>> "
>>>
>>> Another php file:
>>>
>>> "
>>> <?php
>>> echo $_POST["text"];
>>> ?>
>>>
>>> Please what is the correct syntax to apply the css file to the text
>>> entered by the user?
>>>
>> If I understand you question, you can't.
>> When in a variable the text in question is pure ascii (or equivalent in other character
>> sets).
>>
>> CSS is used to format the _display_ of the information.
>> The font information is not carried with the textual information.
>>
>> https://www.php.net/manual/en/mysqlinfo.concepts.charset.php