TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 697
  • Total: 697

[Done!] Join Us! form

Started by mebymyself, October 19, 2006, 08:10:13 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Vapor

d'oh...i just re read your post, you want "posted" text to be colored huh? Im not sure where you would put the code i put in, but that is what you would need to plug in. I just dont know where.  :'(

Vapor

#281
ok...posts say "pending"....how do i "approve" posts?


[SOLVED]

Inny

[code]

global $sourcedir, $user_info, $context ;

require_once($sourcedir . '/Subs.php');
require_once($sourcedir .'/Subs-Post.php');



// CONFIGURATION SECTION

$intro_form = "This is where you give any instructions for filling out the form.";   // Can include html

$thanks_text = "Thanks ever so much for applying. We'll review your application and get back to you."; // what is displayed after the form is submitted

// Define your fields. All of these values need to be defined, even if they are empty.
// The fields will be displayed in the order in which they are listed in the array.
// $fielddef =
//   array(
//     array(
//       'caption' =>      "", // caption to be displayed on the form. Can include symbols and spaces.
//       'name' =>         "", // a unique name for the field. No symbols or spaces
//       'type' =>         "", // text, radio, select, checkbox, textarea, heading
//       'options' =>      "", // for radio and select fields. List in order you wish them to appear, separated by commas; for checkboxes, it's the value to be saved and displayed next to the box
//       'defaultvalue' => "", // the default value for the field. Can be a variable or text. Be sure to enclose text in quotation marks
//       'required' =>     0   // 0 or 1 -- use 1 if the field must be filled out. use 0 if it's optional; never set a checkbox to be required
//     ),
//   );

$fielddef =
  array(
    array(
      'caption' =>      "Name",
      'name' =>         "name",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1  
    ),
    array(
      'caption' =>      "Age",
      'name' =>         "age",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Any activities that will effect your availability (work/school/social)",
      'name' =>         "activities",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "A little about yourself",
      'name' =>         "bio",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Computer Specs (does your computer lag? do you have connection trouble?)",
      'name' =>         "computer",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Information about your character",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Class",
      'name' =>         "class",
      'type' =>         "select",
      'options' =>      "Druid,Hunter,Mage,Paladin,Priest,Rogue,Shaman,Warlock,Warrior,Death Knight",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Race",
      'name' =>         "race",
      'type' =>         "select",
      'options' =>      "Orc,Undead,Troll,Tauren,Blood Elf",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Alts (name/level/class/race/server)",
      'name' =>         "alts",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Experience (Include which character this is on)",
      'name' =>         "heading2",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Pre-TBC",
      'name' =>         "pretbc",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "TBC",
      'name' =>         "tbc",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "WotLK",
      'name' =>         "WotLK",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "Spec",
      'name' =>         "Spec",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
     array(
      'caption' =>      "Do you enjoy your main spec (you will be raiding in this spec)",
      'name' =>         "enjoy",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
     array(
      'caption' =>      "Willing to respec if the guild ask you to",
      'name' =>         "respec",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
    array(
      'caption' =>      "Link to your armoury",
      'name' =>         "armoury",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "Do you have any resistance gear",
      'name' =>         "resistance",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "/Played",
      'name' =>         "played",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "Profession, and any rare recipes",
      'name' =>         "profession",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "How much gold do you have",
      'name' =>         "gold",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "Are you available to raid from 19.00 - 23.00 hours on the following days?",
      'name' =>         "heading2",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
     array(
      'caption' =>      "Monday",
      'name' =>         "monday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
     array(
      'caption' =>      "Tuesday",
      'name' =>         "tuesday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
     array(
      'caption' =>      "Wednesday",
      'name' =>         "wednesday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
     array(
      'caption' =>      "Thursday",
      'name' =>         "thursday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
     array(
      'caption' =>      "Friday",
      'name' =>         "friday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
     array(
      'caption' =>      "Saturday",
      'name' =>         "saturday",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
    array(
      'caption' =>      "Do you have anything planned that will effect your availability (holidays/exams etc)",
      'name' =>         "plans",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "Heroic keys",
      'name' =>         "keys",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
    array(
      'caption' =>      "What can you offer Eternal Pain",
      'name' =>         "offer",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "What are you looking for from Eternal Pain",
      'name' =>         "looking",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
     array(
      'caption' =>      "Do you know anyone in the guild who can vouch for you",
      'name' =>         "vouch",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0  
    ),
    array(
      'caption' =>      "Have you applied anywhere else",
      'name' =>         "applied",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
    array(
      'caption' =>      "Previous guilds / reasons for leaving",
      'name' =>         "previous",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
     array(
      'caption' =>      "Can you confirm you have read, understand and agree to the guildrules?",
      'name' =>         "rules",
      'type' =>         "select",
      'options' =>      "Yes,No",
      'defaultvalue' => "",
      'required' =>     1  
    ),
    array(
      'caption' =>      "Further Comments",
      'name' =>         "comment",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
);


//send the application by email?
$enable_email=false;

// email address of recruitment staff member
$email_address='grkronos@gmail.com';

//post the application on forum?
$enable_post=true;

//board id to which the application should be posted
$board_id=1;


//END OF CONFIGURATION SECTION

$show_form= 'true';
if (isset($_REQUEST['submitted'])) {  // Handle the form

// Check required fields
  $errors = array(); //Initialize error array

  foreach ($fielddef as $field)
    if (empty($_REQUEST[$field['name']]) && ($field['required'] == 1)){ $errors[] = $field['name']; }

// There's at least one field missing
  if (isset($errors[0])) {
    foreach ($_REQUEST as $key => $value)
      $fieldvalue[$key] = $value;
  }
  else { // all is well
    $show_form='false';
    if ($enable_email) {  // email an application
  $subject = 'Enrollment Application';
  $body = 'Enrollment application has been made by ' . $context['user']['name'] .
          ' from IP Address ' . $user_info['ip'] . '
              ';
      foreach ($fielddef as $field) {
        $body .= $field['caption'] . ': ' . $_REQUEST[$field['name']] . '
        ';
      }
      mail($email_address, $subject, $body,"From: " . $user_info['email']);
    }

    if ($enable_post) {  //create new forum post with application

      $postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
                   <table>';
      foreach ($fielddef as $field) {
        $postbody .= '<tr><td>' . $field['caption'] . '<td></td><td>  ' . $_REQUEST[$field['name']] . '</td></tr>';
      }
      $postbody .= '</table>';

      $msgOptions = array(
        'id' =>  0 ,
        'subject' => '[Pending] Application of ' . $context['user']['name'],
        'body' => $postbody ,
        'icon' => 'xx',
        'smileys_enabled' => true,
        'attachments' =>  array(),
      );
      $topicOptions = array(
        'id' => 0 ,
        'board' => $board_id,
        'poll' =>  null,
        'lock_mode' =>  null,
        'sticky_mode' =>  null,
        'mark_as_read' => true,
      );
      $posterOptions = array(
        'id' => $context['user']['id'],
        'name' => $context['user']['name'],
        'email' => $user_info['email'],
        'update_post_count' => true,
      );
      createPost($msgOptions, $topicOptions, $posterOptions);
    }
// Text for thank you page

    echo $thanks_text;
  }
}

// Looks like you want the form,
if ($show_form == 'true') {
  echo $intro_form . "<br>";
  if (isset($errors[0])) { echo '<div style="color: red;">Please fill in all fields with a *.</div>';  }
  echo '<form action="' . $scripturl . '?page='  . $_GET['page'] . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
        <center><table width="100%">';
  $bg = 'windowbg2';
  foreach ($fielddef as $field) {
    if ($field['type'] == 'text') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><INPUT id="' . $field['name'] . '" name="' . $field['name'] . '" type="text" value ="' . $fieldvalue[$field['name']] . '" /></TD>
            </TR>';
    }
    elseif ($field['type'] == 'radio') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left">';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<INPUT TYPE="RADIO" NAME="' . $field['name'] . '" VALUE="'. $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' CHECKED'; }
                echo '>' . $option . ' ';
              }
              echo '</TD>
            </TR>';  
    }
    elseif ($field['type'] == 'checkbox') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              echo $field['caption'] . ':</TD>
              <TD align="left">';
                echo '<INPUT TYPE="CHECKBOX" NAME="' . $field['name'] . '" VALUE="'. $field['options'] . '"';
                if (isset($fieldvalue[$field['name']]) && ($fieldvalue[$field['name']]==$field['options'])) { echo ' CHECKED'; }
                echo '>' . $field['options'] . '
            </TR>';  
    }
    elseif ($field['type'] == 'select') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><SELECT id="' . $field['name'] . '" name="' . $field['name'] . '" style="WIDTH: 152px" value ="';
              echo '" />';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<OPTION value="' . $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' selected'; }
                echo '>' . $option . '</OPTION>';
            }
            echo '</SELECT></TD>
            </TR>';
    }
    elseif ($field['type'] == 'textarea') {
      echo '<TR class ="' . $bg . '">
            <TD width = "200px" align="right">';
            if ($field['required'] == 1) { echo '* '; }
            echo $field['caption'] . ':</TD>
            <TD align="left"><TEXTAREA id="' . $field['name'] . '" name="' . $field['name'] . '" rows="4" cols="40">';
            echo $fieldvalue[$field['name']];
            echo '</' . 'TEXTAREA></TD>
  </TR>';
    }
    elseif ($field['type'] == 'heading') {
      echo '<TR class ="' . $bg . '">
            <TD colspan="2">' .
            $field['caption'] .
            '</TD></TR>';
    }
    if ($bg == 'windowbg2') { $bg = 'windowbg'; }
    else { $bg = 'windowbg2'; }
  }
  echo '
    <TR class ="' . $bg . '">
      <TD colspan="2" align="center">
        <INPUT type="submit" value="Submit">
        <INPUT type="reset" value="Reset"></TD>
    </TR></TABLE></center></form>';
}





I like using your code JPDeni instead of the OP one because its easier for editing but also because i can fit it better with the guests application forms.

Only issue i have with is that i altered the heading code a bit to make it seem like a title of which type of questions following below it. Problem is that when its posted into forums the Heading its gets the coloring and the posting body of the all the other fields. What i say is if its possible to make the heading field post differently in forums.

Right now im using: foreach ($fielddef as $field) {
        $postbody .= '[color=green][b]' . $field['caption'] . '[/b][/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }


What i want to do is something like: foreach ($fielddef as $field) {
        $postbody .= '[color=red][b]' . $field['caption'] . '[/b][/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }
[/code] for just the Heading array.

I tried changing the code to:

  elseif ($field['type'] == 'heading') {
      echo '<center><table cellSpacing="1" cellPadding="1" width="50%"><TR>
            <font size="8"><TD style="text-align: center; text-decoration: underline;" colspan="2"><font size="4">' .
            $field['heading'] .
            '</font></TD></TR></table>';
    }



AND..

if ($enable_post) {  //create new forum post with application

      $postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
      ';
      foreach ($fielddef as $field) {
        $postbody .= '[color=green][b]' . $field['caption'] . '[/b][/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }

   foreach ($fielddef as $field) {
        $postbody .= '[color=red][b]' . $field['heading'] . '[/b][/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }
      $postbody .= '';


but only thing i managed is to have something like 2 forms in one post and one was missing the Question  :). Poor Php skills leads to that i guess, my best guess is that somewhere i need "if" "or" "and", i dont really know  :2funny:

Any help appreciated.

JPDeni

Your first change of the code is going to cause real problems because you have messed up the table, starting a new one without closing the old.

This might work:


  elseif ($field['type'] == 'heading') {
      echo '<tr><TD colspan="2"><center><table cellSpacing="1" cellPadding="1" width="50%"><TR>
            <font size="8"><TD style="text-align: center; text-decoration: underline; color: green;"><font size="4">' .
            $field['heading'] .
            '</font></TD></TR></table></td></tr>';
    }


As for the post, you need an "if". :)

Quote
      foreach ($fielddef as $field) {
        if ($field['type'] == 'heading')
          $postbody .= '<tr><td>' . $field['caption'] . '<td></td><td>  ' . $_REQUEST[$field['name']] . '</td></tr>';
        else
          $postbody .= '<tr><td>' . $field['caption'] . '<td></td><td>  ' . $_REQUEST[$field['name']] . '</td></tr>';
      }

Inny

Quote from: JPDeni on February 04, 2009, 02:25:45 PM
Your first change of the code is going to cause real problems because you have messed up the table, starting a new one without closing the old.

This might work:


  elseif ($field['type'] == 'heading') {
      echo '<tr><TD colspan="2"><center><table cellSpacing="1" cellPadding="1" width="50%"><TR>
            <font size="8"><TD style="text-align: center; text-decoration: underline; color: green;"><font size="4">' .
            $field['heading'] .
            '</font></TD></TR></table></td></tr>';
    }


As for the post, you need an "if". :)

Quote
      foreach ($fielddef as $field) {
        if ($field['type'] == 'heading')
          $postbody .= '<tr><td>' . $field['caption'] . '<td></td><td>  ' . $_REQUEST[$field['name']] . '</td></tr>';
        else
          $postbody .= '<tr><td>' . $field['caption'] . '<td></td><td>  ' . $_REQUEST[$field['name']] . '</td></tr>';
      }



Copy/Paste is evil sometimes tho i dont know who to blame more, me for copying from your reply or you for copying from mine  :2funny:

  elseif ($field['type'] == 'heading') {
      echo '<tr><TD colspan="2"><center><table cellSpacing="1" cellPadding="1" width="50%"><TR>
            <font size="8"><TD style="text-align: center; text-decoration: underline; color: green;"><font size="4">' .
           $field['heading'] .
            '</font></TD></TR></table></td></tr>';
    }


In the above:
$field['heading'] .
should be
$field['caption'] .

It works like a charm besides that copy/paste mistake, that wasted like 20mins of my time till i see it :P. Before that no headings were showed in the form.

Thanks JPDeni.

JPDeni

:) Well, you've looked at the code a whole lot more recently than I have. I pretty much have to start over from the beginning when I haven't seen the code for a week or more. This stuff doesn't stick in my head.

Glad you got it worked out. :)

darrenelkins

HI all,

I need some adivce, I got this script working a treat thanks very much, however I get this error on every submit:

"Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later."

It does not even reach the Thank You article, however it is adding the posts and emailing me the applications.

I have not altered the code other than simple text and email address, so no point in pasting it all again :)

Cheers

JPDeni

If it's adding the posts, then it is able to access the database. There's something happening after the submit button is pushed. I don't know what it could be, though.

darrenelkins

#288
Quote from: JPDeni on February 09, 2009, 09:41:22 PM
If it's adding the posts, then it is able to access the database. There's something happening after the submit button is pushed. I don't know what it could be, though.

hmm, ok I have added my the script, just in case something is not right.

Thanks.

---


if ($context['user']['is_guest'])
{
   echo
   '<h5>Access Denied</h5>
   We are sorry. You must be registred on the site in order to apply for Wisdom and Strength.';
} else  { // remove closing bracket


global $sourcedir, $user_info, $context ; $scripturl ;

require_once($sourcedir . '/Subs.php');
require_once($sourcedir .'/Subs-Post.php');



// CONFIGURATION SECTION

//send the application by email?
$enable_email=true;

// email address of recruitment staff member
$email_address='xxxx';

//post the application on forum?
$enable_post=true;

//board id to which the application should be posted
$board_id=15.0;

//the id of the this article
$this_article_id = '14';

//article to be redirected when form is submitted
$thank_you_article_id = '13';


//END OF CONFIGURATION SECTION

$show_form= 'true';
if (isset($_POST['submitted'])) {
// Handle the form

// Check required fields
$enroll_errors = array(); //Initialize error array

// Check for a name
if (empty($_POST['real_name']) ){
$enroll_errors[] = 'You forgot to enter your name.';
}
// Check for an email
if (empty($_POST['email']) ){
$enroll_errors[] = 'You forgot to enter your email address.';

// Check for an location
if (empty($_POST['location']) ){
$enroll_errors[] = 'You forgot to enter your location.';
}
   
// Check for an age
if (empty($_POST['age']) ){
$enroll_errors[] = 'You forgot to enter your age.';
}

// Check for an class
if (empty($_POST['class']) ){
$enroll_errors[] = 'You forgot to enter your class.';
}

// Check for an race
if (empty($_POST['race']) ){
$enroll_errors[] = 'You forgot to enter your race.';
}

// Check for an level
if (empty($_POST['level']) ){
$enroll_errors[] = 'You forgot to enter your level.';
}

// Check for an professions
if (empty($_POST['professions']) ){
$enroll_errors[] = 'You forgot to enter your professions.';
}

// Check for an attunements
if (empty($_POST['attunements']) ){
$enroll_errors[] = 'You forgot to enter your attunements.';
}

// Check for an playtime
if (empty($_POST['playtime']) ){
$enroll_errors[] = 'You forgot to enter your playtimes.';
}

// Check for an talents
if (empty($_POST['talents']) ){
$enroll_errors[] = 'You forgot to enter your talents.';
}

// Check for an ventrilo
if (empty($_POST['ventrilo']) ){
$enroll_errors[] = 'You forgot to enter your ventrilo question.';
}

// Check for an pvp
if (empty($_POST['pvp']) ){
$enroll_errors[] = 'You forgot to enter your pvp.';
}

// Check for an contribution
if (empty($_POST['contribution']) ){
$enroll_errors[] = 'You forgot to enter your contribution question.';
}

// Check for an why
if (empty($_POST['why']) ){
$enroll_errors[] = 'You forgot to enter why you want to join us.';
}                   
    }

if (empty($enroll_errors)) { //Everything seems to be OK
     
        $show_form='false';



// email an application

$subject = 'Enrollment Application';
$body = 'Enrollment application has been made by ' . $context['user']['name'] .
' from IP Address ' . $user_info['ip'] . '
Name: ' . $_POST['name'] . '
Email address: ' . $_POST['email'] . '
Location: ' . $_POST['location'] . '
Gender: ' . $_POST['gender'] . '
Age: ' . $_POST['age'] . '
Class: ' . $_POST['class'] . '
Race: ' . $_POST['race'] . '
Level: ' . $_POST['level'] . '
Professions[/b]: ' . $_POST['professions'] . '
Attunements: ' . $_POST['attunements'] . '
Playtime: ' . $_POST['playtime'] . '
Talents: ' . $_POST['talents'] . '
TS: ' . $_POST['ventrilo'] . '
PvP: ' . $_POST['pvp'] . '
CTprofile: ' . $_POST['ctprofile'] . '
Contribution: ' . $_POST['contribution'] . '
Why do you want to join our guild? ' . $_POST['why'] . '
Other information: ' . $_POST['other'];

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
<table>
<tr><td>Name:<td></td><td>  ' . $_POST['real_name'] . '</td></tr>
<tr><td>Email address:<td></td><td>  ' . $_POST['email'] . '</td></tr>
<tr><td>Location:<td></td><td>  ' . $_POST['location'] . '</td></tr>
<tr><td>Gender:<td></td><td>  ' . $_POST['gender'] . '</td></tr>
<tr><td>Age:<td></td><td>  ' . $_POST['age'] . '</td></tr>
<tr><td>Class:<td></td><td> ' . $_POST['class'] . '</td></tr>
<tr><td>Race:<td></td><td> ' . $_POST['race'] . '</td></tr>
<tr><td>Level:<td></td><td> ' . $_POST['level'] . '</td></tr>
<tr><td>Professions:<td></td><td>  ' . $_POST['professions'] . '</td></tr>
<tr><td>Attunements:<td></td><td>  ' . $_POST['attunements'] . '</td></tr>
<tr><td>Playtime:<td></td><td>  ' . $_POST['playtime'] . '</td></tr>
<tr><td>Talents:<td></td><td>  ' . $_POST['talents'] . '</td></tr>
<tr><td>TS:<td></td><td>  ' . $_POST['ventrilo'] . '</td></tr>
<tr><td>PvP:<td></td><td>  ' . $_POST['pvp'] . '</td></tr>
<tr><td>CTprofile:<td></td><td>  ' . $_POST['ctprofile'] . '</td></tr>
<tr><td>Contribution:<td></td><td>  ' . $_POST['contribution'] . '</td></tr>
<tr><td>Why do you wanna join this guild:<td></td><td>  ' . $_POST['why'] . '</td></tr>
<tr><td>Other information:<td></td><td>  ' . $_POST['other']. '</td></tr>
</table>';



            if ($enable_email)
mail($email_address, $subject, $body,"From: " . $_POST['email']);



//create new forum post with application

$msgOptions = array(
'id' =>  0 ,
'subject' => '[Pending] Application of ' . $context['user']['name'] . ' ' . $_POST['level'] . ' ' . $_POST['class'],
'body' => $postbody ,
'icon' => 'xx',
'smileys_enabled' => true,
'attachments' =>  array(),
);
$topicOptions = array(
'id' => 0 ,
'board' => $board_id,
'poll' =>  null,
'lock_mode' =>  null,
'sticky_mode' =>  null,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $context['user']['id'],
'name' => $context['user']['name'],
'email' => $user_info['email'],
'update_post_count' => true,
);
   
if ($enable_post)
            createPost($msgOptions, $topicOptions, $posterOptions);

// Redirect to thank you page
header('Location: http://' . $_SERVER['HTTP_HOST'] .'/index.php?page=' . $thank_you_article_id);

} else {
// Redirect to error page
//header('Location: http://' . $_SERVER['HTTP_HOST'] . '/index.php?page=' . $enroll_error_article_id );
echo '<h2 class="error">Error!</h2>';
echo '<p class="error">The following error(s) occured:<br />';

foreach ($enroll_errors as $msg) {
echo " - $msg<br />";
}
   echo "<p>Please, correct all errors and try again.</p>" ;



}
}
//else { // Display the form

echo '
<form action="index.php?page='  . $this_article_id  . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
<TABLE class = "bordercolor" cellSpacing="1" cellPadding="1" width="95%" border="0">
<TR class ="windowbg">
<TD width = "200px">Character Name:</TD>
<TD><INPUT id="real_name" name="real_name" type="text" value ="';
if (isset($_POST['real_name'])) echo $_POST['real_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Email address:</TD>
<TD><INPUT id="email" name="email" type="text" value ="';
if (isset($_POST['email'])) echo $_POST['email']; else echo $user_info['email']; 
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Location:</TD>
<TD><INPUT id="location" name="location" type="text" value ="';
if (isset($_POST['location'])) echo $_POST['location'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Gender:
</TD>
<TD><SELECT id = "gender" name = "gender" style="WIDTH: 152px" value ="';
if (isset($_POST['gender'])) echo $_POST['gender'];   
echo '" />
<OPTION value="No Answer" selected>--------------------------</OPTION>
<OPTION value="Male">Male</OPTION>
<OPTION value="Female">Female</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Age:</TD>
<TD><INPUT id="age" name="age" type="text" value ="';
if (isset($_POST['age'])) echo $_POST['age'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Class:</TD>
                                </TD>
<TD><SELECT id="class" name= "class" style="WIDTH: 152px" value ="';
if (isset($_POST['class'])) echo $_POST['class'];   
echo '" />
<OPTION value="No Answer" selected>--------------------------</OPTION>
<OPTION value="Druid">Druid</OPTION>
<OPTION value="Hunter">Hunter</OPTION>
<OPTION value="Mage">Mage</OPTION>
<OPTION value="Paladin">Paladin</OPTION>
<OPTION value="Priest">Priest</OPTION>
<OPTION value="Rogue">Rogue</OPTION>
<OPTION value="Warlock">Warlock</OPTION>
<OPTION value="Warrior">Warrior</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Race:</TD>
                                </TD>
<TD><SELECT id="race" name= "race" style="WIDTH: 152px" value ="';
if (isset($_POST['race'])) echo $_POST['race'];   
echo '" />
<OPTION value="No Answer" selected>--------------------------</OPTION>
<OPTION value="Dwarf">Dwarf</OPTION>
<OPTION value="Human">Human</OPTION>
<OPTION value="Gnome">Gnome</OPTION>
<OPTION value="Night Elf">Night Elf</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Level:</TD>
<TD><INPUT id ="level" name ="level" type="text" value ="';
if (isset($_POST['level'])) echo $_POST['level'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">What are your professions?</TD>
<TD><INPUT id ="professions" name ="professions" type="text" value ="';
if (isset($_POST['professions'])) echo $_POST['professions'];   
echo '"  /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Which attunements do you have?</TD>
<TD><INPUT id="attunements" name="attunements" type="text" value ="';
if (isset($_POST['attunements'])) echo $_POST['attunements']; 
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">At which times do you play daily?</TD>
<TD><INPUT id="playime" name="playtime" type="text" value ="';
if (isset($_POST['playtime'])) echo $_POST['playtime']; 
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">What is your current talentbuild?</TD>
<TD><INPUT id="talents" name="talents" type="text" value ="';
if (isset($_POST['talents'])) echo $_POST['talents'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Do you have Ventrilo installed?:</TD>
<TD><SELECT id="ventrilo" name="ventrilo" style="WIDTH: 160px" value ="';
if (isset($_POST['ventrilo'])) echo $_POST['ventrilo'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Do you PvP often and is this very important to you?</TD>
<TD><INPUT id="pvp" name="pvp" type="text" value ="';
if (isset($_POST['pvp'])) echo $_POST['pvp'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">If you have a CTprofile, then please link it here:</TD>
<TD><INPUT id="ctprofile" name="ctprofile" type="text" value ="';
if (isset($_POST['ctprofile'])) echo $_POST['ctprofile'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">How do you think you can contribute to the guild?</TD>
<TD><TEXTAREA id="contribution" name ="contribution" rows="4" cols="40" value ="';
if (isset($_POST['contribution'])) echo $_POST['contribution'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Why do you wanna join us?
</TD>
<TD><TEXTAREA id="why" name = "why" rows="4" cols="40" value ="';
if (isset($_POST['why'])) echo $_POST['why'];
echo '" ></' . 'TEXTAREA></TD> </TR>

<TR class ="windowbg2">
<TD width = "200px">Any other information you think can help us to make a decision:</TD>
<TD><TEXTAREA id="other" name = "other" rows="4" cols="40" value ="';
if (isset($_POST['other'])) echo $_POST['other'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<TD colspan="2" align="center">
<INPUT type="submit" value="Submit">
<INPUT type="reset" value="Reset"></TD>
</TR>
</TABLE>
</form>

';
} // Closing at the very end of the code




JPDeni

I put your code in code tags so I could read it.

I didn't write this code, so I can't really tell what's going on. It probably would be best to see if you can contact the original author of the code.

This website is proudly hosted on Crocweb Cloud Website Hosting.