Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > RocketCake
How can I format the ›echo‹ in a contact form?

indukt
Registered User
Quote
2021-06-18 19:09:39

Hello,

I have a question on behalf of the tutorial »How to create a contact form«: How can I change the font-family, size, etc. in the ›echo‹ within the PHP-Script?


indukt
Registered User
Quote
2021-06-18 23:39:10

To be concrete, I am talking about this script:



$text = "";

foreach($_POST as $name => $value)

{

$text .= "$name : $value\n";

}


if ($text != "")

{

echo 'Thanks for contacting us.';

mail("youremail@example.com", "Contact form request", $text);

}


erik
Registered User
Quote
2021-06-19 07:43:42

You could either embed your php code in a section with that font set ( havent tried this out yet, so I'm not 100% sure), or you could also write out a font or style with the echo command. Its not restricted to only text.

Like
echo '<div style="font-size: 16px">your text</div>



indukt
Registered User
Quote
2021-06-19 16:11:13

Thank you for the rapid answer, which was helping me much. My final PHP-script which is defining the font-familiy (Saira Condensed) and the size (48 pixels) now looks like this – and it works well:



$text = "";
foreach($_POST as $name => $value)
{
$text .= "$name : $value\n";
}

if ($text != "")
{
echo '<div style="font-family: Saira Condensed; font-size: 48px">Thanks for contacting us.</div>';
mail("test@example.de", "Contact form request", $text);
}


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact