Completely inexperienced in php. I've checked around and found suggestions on how to use form_mail in regards to setting up a static page, however, i'd like to place a form in a block.

Is this possible? How might it be done? Is form_mail the right answer for this?

Comments

argyle’s picture

searched and read a little more on this, but i'm still coming up with problems on it. found http://drupal.org/node/5180 with php examples to try including:

<?php
$form .= form_textfield("Subject", "subject", "", 60, 70);
$form .= form_textfield("Name", "from_name", "", 60, 128);
$form .= form_textfield("Email", "from_email", "", 60, 128, "Please fill this out if you would like a response by email");
$form .= form_textarea("Message", "body", "", 60, 15);
$form .= form_submit("Send email");
echo form($form, "post", "form_mail");
?> 

which just gets me an empty block on my site. As suggested on the above link, I tried the exact same code without the php tags at the beginning and end and then it simply displays the remainder of the code in the block.

nevets’s picture

When you created the block did you set the 'input format' to PHP code?

argyle’s picture

no, i didn't. thanks, problem resolved.