0 Members and 2 Guests are viewing this topic.
I pasted this code into a .php and called for it in an article
I have also attempted to put this straight into a PHP article
I saved the code in a file called "application.php" and changed my article type to External Article.
I am able to save just plain text in a php article, but it seems to give me an error whenever I add code.
array( 'caption' => "<FONT COLOR=red>Age</font>", 'name' => "age", 'type' => "select", 'options' => "13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40+", 'defaultvalue' => "18", 'required' => 1
if ($enable_post) { //create new forum post with application $postbody = 'Recruitment application has been made by ' . $context['user']['name'] .'<br /><br/>'; foreach ($fielddef as $field) { if ($field['type'] == 'heading') $postbody .= $field['caption'] . '<br />'; else $postbody = '[html]' . $field['caption'] . ': ' . $_REQUEST[$field['name']] . '[/html]<br />';
[html] brackets
This all looks great on the form and looks great in the forum post however, if I go to modify the post exg; change topic from pending to accepted the body of the post becomes full of html that is out putted into html in the form of a php ' echo ' instead of keeping its coding./quote]That's because the code wasn't written to do that. If you want to change the outputted formatting, you should change it in the output part of the code, not the field definitions.
$postbody = '[html]' . $field['caption'] . ': ' . $_REQUEST[$field['name']] . '[/html]<br />';
$intro_form = "Put whatever introduction you want to appear at the top of the form here. You can add html. Be careful with quotation marks."; $thanks_text = "This is what will appear after the form is submitted. You can use html. Be careful with quotation marks.";
Can include symbols and spaces.