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: 1
  • Guests: 362
  • Total: 363
  • tino

[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.

harlequindreamsx

Quote from: Hairy on January 27, 2008, 01:11:04 PM
Are you using the latest version of SMF?

I installed the current version today and everything works now :)

CampCounselor

I need the code again guys. it is a little hard to read through this. the code is posted in so many posts. I did have it working but it is not working now. I have the form displace

the site it is in is localhost/ACE. After I submit it it is sending me to mike-pc/xampp or localhost/xampp. Not what i want.

below is my code


global $sourcedir, $user_info, $context ;

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



// CONFIGURATION SECTION

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

// email address of reqruitment staf member
$email_address='recruitement@your-clan.com';

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

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

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

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


//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 AA name
if (empty($_POST['aa_name']) ){
$enroll_errors[] = 'You forgot to enter your In-Game Nickname.';
}       
// Check for an age
if (empty($_POST['age']) ){
$enroll_errors[] = 'You forgot to enter your age.';


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'] . '
Real Name:  ' . $_POST['real_name'] . '
Email address:  ' . $_POST['email'] . '
Current Game Name:  ' . $_POST['aa_name'] . '
Age:  ' . $_POST['age'] . '
Gender: ' . $_POST['gender'] . '
Location:  ' . $_POST['location'] . '
Current Honor:  ' . $_POST['honor'] . '
Previous clan(s):  ' . $_POST['prev_clans'] . '
Banned from any sever:  ' . $_POST['banned'] . '
Registered with AAOTracker? ' . $_POST['aaotracker'] . '
AAOTracker name:  ' . $_POST['aaotracker_name'] . '
Registred with X-fire?  ' . $_POST['xfire'] . '
X-Fire Account:  ' . $_POST['xfire_name'] . '
TeamSpeak installed?:  ' . $_POST['ts'] . '
Have microphone/headset:  ' . $_POST['mic'] . '
Would like to help pay for a server?: ' . $_POST['pay'] . '
Why do you want to join our clan?  ' . $_POST['why'] . '
Gaming habbits:   ' . $_POST['habbits'] . '
Other information:  ' . $_POST['other'];

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
<table>
<tr><td>Real Name:<td></td><td>  ' . $_POST['real_name'] . '</td></tr>
<tr><td>Email address:<td></td><td>  ' . $_POST['email'] . '</td></tr>
<tr><td>Current Game Name:<td></td><td>  ' . $_POST['aa_name'] . '</td></tr>
<tr><td>Age:<td></td><td>  ' . $_POST['age'] . '</td></tr>
<tr><td>Gender: <td></td><td>' . $_POST['gender'] . '</td></tr>
<tr><td>Location:<td></td><td>  ' . $_POST['location'] . '</td></tr>
<tr><td>Current Honor: <td></td><td> ' . $_POST['honor'] . '</td></tr>
<tr><td>Previous clan(s): <td></td><td> ' . $_POST['prev_clans'] . '</td></tr>
<tr><td>Banned from any sever: <td></td><td> ' . $_POST['banned'] . '</td></tr>
<tr><td>Registered with AAOTracker? <td></td><td>' . $_POST['aaotracker'] . '</td></tr>
<tr><td>AAOTracker name:  <td></td><td>' . $_POST['aaotracker_name'] . '</td></tr>
<tr><td>Registred with X-fire? <td></td><td> ' . $_POST['xfire'] . '</td></tr>
<tr><td>X-Fire Account: <td></td><td> ' . $_POST['xfire_name'] . '</td></tr>
<tr><td>TeamSpeak installed?: <td></td><td> ' . $_POST['ts'] . '</td></tr>
<tr><td>Have microphone/headset: <td></td><td> ' . $_POST['mic'] . '</td></tr>
<tr><td>Would like to help pay for a server?:<td></td><td> ' . $_POST['pay'] . '</td></tr>
<tr><td>Why do you want to join our clan? <td></td><td> ' . $_POST['why'] . '</td></tr>
<tr><td>Gaming habbits: <td></td><td> ' . $_POST['habbits'] . '</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'],
'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">* Your 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">* Current AA In-Game Nick:</TD>
<TD><INPUT id="aa_name" name="aa_name" type="text" value ="';
if (isset($_POST['aa_name'])) echo $_POST['aa_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<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 ="windowbg">
<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="M">Male</OPTION>
<OPTION value="F">Female</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<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 ="windowbg">
<TD width = "200px">Current Honor:</TD>
<TD><INPUT id="honor" name="honor" type="text" value ="';
if (isset($_POST['honor'])) echo $_POST['honor'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Previous clan(s) and reason of leaving:</TD>
<TD><TEXTAREA id="prev_clans" name="prev_clans" rows="4" cols="40" value ="';
if (isset($_POST['prev_clans'])) echo $_POST['prev_clans'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Have you ever been permanently banned from any sever (if yes, give details):</TD>
<TD><TEXTAREA id ="banned" name ="banned" rows="4" cols="40"  value ="';
if (isset($_POST['banned'])) echo $_POST['banned'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Registered with AAOTracker?</TD>
<TD><SELECT id="aaotracker" name="aaotracker" style="WIDTH: 160px" value ="';
if (isset($_POST['aaotraker'])) echo $_POST['aaotraker'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">AAOTracker name:</TD>
<TD><INPUT id="aaotracker_name" name="aaotracker_name" type="text" value ="';
if (isset($_POST['aaotraker_name'])) echo $_POST['aaotraker_name']; 
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Registred with X-fire?</TD>
<TD><SELECT id="xfire" name="xfire" style="WIDTH: 160px" value ="';
if (isset($_POST['xfire'])) echo $_POST['xfire'];
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">X-Fire Account:</TD>
<TD><INPUT id="xfire_name" name="xfire_name" type="text" value ="';
if (isset($_POST['xfire_name'])) echo $_POST['xfire_name'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Do you have TeamSpeak installed?:</TD>
<TD><SELECT id="ts" name="ts" style="WIDTH: 160px" value ="';
if (isset($_POST['ts'])) echo $_POST['ts'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Do you have microphone/headset:</TD>
<TD><SELECT id="mic" name="mic" style="WIDTH: 160px" value ="';
if (isset($_POST['mic'])) echo $_POST['mic'];   
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">Would you help pay for a server?:</TD>
<TD><SELECT id="pay" name="pay" style="WIDTH: 160px" value ="';
if (isset($_POST['pay'])) echo $_POST['pay'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="Monthly">Yes, monthly</OPTION>
<OPTION value="Occasionally">Yes, occasionally</OPTION>
<OPTION value="Not">No, not now</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Why do you want to join -WoW-?</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">Tell us about your gaming habbits:
</TD>
<TD><TEXTAREA id="habbits" name="habbits" rows="4" cols="40" value ="';
if (isset($_POST['habbits'])) echo $_POST['habbits'];
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<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 ="windowbg2">
<TD colspan="2" align="center">
<INPUT type="submit" value="Submit">
<INPUT type="reset" value="Reset"></TD>
</TR>
</TABLE>
</form>

';

Hairy

See if this works for you:

global $sourcedir, $user_info, $context ;

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



// CONFIGURATION SECTION

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

// email address of reqruitment staf member
$email_address='recruitement@your-clan.com';

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

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

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

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


//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 AA name
if (empty($_POST['aa_name']) ){
$enroll_errors[] = 'You forgot to enter your In-Game Nickname.';
}       
// Check for an age
if (empty($_POST['age']) ){
$enroll_errors[] = 'You forgot to enter your age.';


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'] . '
Real Name:  ' . $_POST['real_name'] . '
Email address:  ' . $_POST['email'] . '
Current Game Name:  ' . $_POST['aa_name'] . '
Age:  ' . $_POST['age'] . '
Gender: ' . $_POST['gender'] . '
Location:  ' . $_POST['location'] . '
Current Honor:  ' . $_POST['honor'] . '
Previous clan(s):  ' . $_POST['prev_clans'] . '
Banned from any sever:  ' . $_POST['banned'] . '
Registered with AAOTracker? ' . $_POST['aaotracker'] . '
AAOTracker name:  ' . $_POST['aaotracker_name'] . '
Registred with X-fire?  ' . $_POST['xfire'] . '
X-Fire Account:  ' . $_POST['xfire_name'] . '
TeamSpeak installed?:  ' . $_POST['ts'] . '
Have microphone/headset:  ' . $_POST['mic'] . '
Would like to help pay for a server?: ' . $_POST['pay'] . '
Why do you want to join our clan?  ' . $_POST['why'] . '
Gaming habbits:   ' . $_POST['habbits'] . '
Other information:  ' . $_POST['other'];

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
<table>
<tr><td>Real Name:<td></td><td>  ' . $_POST['real_name'] . '</td></tr>
<tr><td>Email address:<td></td><td>  ' . $_POST['email'] . '</td></tr>
<tr><td>Current Game Name:<td></td><td>  ' . $_POST['aa_name'] . '</td></tr>
<tr><td>Age:<td></td><td>  ' . $_POST['age'] . '</td></tr>
<tr><td>Gender: <td></td><td>' . $_POST['gender'] . '</td></tr>
<tr><td>Location:<td></td><td>  ' . $_POST['location'] . '</td></tr>
<tr><td>Current Honor: <td></td><td> ' . $_POST['honor'] . '</td></tr>
<tr><td>Previous clan(s): <td></td><td> ' . $_POST['prev_clans'] . '</td></tr>
<tr><td>Banned from any sever: <td></td><td> ' . $_POST['banned'] . '</td></tr>
<tr><td>Registered with AAOTracker? <td></td><td>' . $_POST['aaotracker'] . '</td></tr>
<tr><td>AAOTracker name:  <td></td><td>' . $_POST['aaotracker_name'] . '</td></tr>
<tr><td>Registred with X-fire? <td></td><td> ' . $_POST['xfire'] . '</td></tr>
<tr><td>X-Fire Account: <td></td><td> ' . $_POST['xfire_name'] . '</td></tr>
<tr><td>TeamSpeak installed?: <td></td><td> ' . $_POST['ts'] . '</td></tr>
<tr><td>Have microphone/headset: <td></td><td> ' . $_POST['mic'] . '</td></tr>
<tr><td>Would like to help pay for a server?:<td></td><td> ' . $_POST['pay'] . '</td></tr>
<tr><td>Why do you want to join our clan? <td></td><td> ' . $_POST['why'] . '</td></tr>
<tr><td>Gaming habbits: <td></td><td> ' . $_POST['habbits'] . '</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'],
'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: '.$scripturl.'?page=' . $thank_you_article_id);

} else {
// Redirect to error page
//header('Location: '.$scripturl.'?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">* Your 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">* Current AA In-Game Nick:</TD>
<TD><INPUT id="aa_name" name="aa_name" type="text" value ="';
if (isset($_POST['aa_name'])) echo $_POST['aa_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<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 ="windowbg">
<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="M">Male</OPTION>
<OPTION value="F">Female</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<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 ="windowbg">
<TD width = "200px">Current Honor:</TD>
<TD><INPUT id="honor" name="honor" type="text" value ="';
if (isset($_POST['honor'])) echo $_POST['honor'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Previous clan(s) and reason of leaving:</TD>
<TD><TEXTAREA id="prev_clans" name="prev_clans" rows="4" cols="40" value ="';
if (isset($_POST['prev_clans'])) echo $_POST['prev_clans'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Have you ever been permanently banned from any sever (if yes, give details):</TD>
<TD><TEXTAREA id ="banned" name ="banned" rows="4" cols="40"  value ="';
if (isset($_POST['banned'])) echo $_POST['banned'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Registered with AAOTracker?</TD>
<TD><SELECT id="aaotracker" name="aaotracker" style="WIDTH: 160px" value ="';
if (isset($_POST['aaotraker'])) echo $_POST['aaotraker'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">AAOTracker name:</TD>
<TD><INPUT id="aaotracker_name" name="aaotracker_name" type="text" value ="';
if (isset($_POST['aaotraker_name'])) echo $_POST['aaotraker_name']; 
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Registred with X-fire?</TD>
<TD><SELECT id="xfire" name="xfire" style="WIDTH: 160px" value ="';
if (isset($_POST['xfire'])) echo $_POST['xfire'];
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">X-Fire Account:</TD>
<TD><INPUT id="xfire_name" name="xfire_name" type="text" value ="';
if (isset($_POST['xfire_name'])) echo $_POST['xfire_name'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Do you have TeamSpeak installed?:</TD>
<TD><SELECT id="ts" name="ts" style="WIDTH: 160px" value ="';
if (isset($_POST['ts'])) echo $_POST['ts'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Do you have microphone/headset:</TD>
<TD><SELECT id="mic" name="mic" style="WIDTH: 160px" value ="';
if (isset($_POST['mic'])) echo $_POST['mic'];   
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">Would you help pay for a server?:</TD>
<TD><SELECT id="pay" name="pay" style="WIDTH: 160px" value ="';
if (isset($_POST['pay'])) echo $_POST['pay'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="Monthly">Yes, monthly</OPTION>
<OPTION value="Occasionally">Yes, occasionally</OPTION>
<OPTION value="Not">No, not now</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Why do you want to join -WoW-?</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">Tell us about your gaming habbits:
</TD>
<TD><TEXTAREA id="habbits" name="habbits" rows="4" cols="40" value ="';
if (isset($_POST['habbits'])) echo $_POST['habbits'];
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<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 ="windowbg2">
<TD colspan="2" align="center">
<INPUT type="submit" value="Submit">
<INPUT type="reset" value="Reset"></TD>
</TR>
</TABLE>
</form>

';



I just replaced the 2 entries ofhttp://' . $_SERVER['HTTP_HOST'] . '/index.php

with '.$scripturl.'

This should avoid problems where people have their forums in a folder extension (I think) :)

CampCounselor

#193
had another person help me but i also have a problem with the amoutn of space between the first line and the second line of hte post

i also can not edit the post because i will do that and then have it just show html code

EDIT
hairy what theme is that?

Hairy

See this code

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
<table>
<tr><td>Real Name:<td></td><td>  ' . $_POST['real_name'] . '</td></tr>
<tr><td>Email address:<td></td><td>  ' . $_POST['email'] . '</td></tr>
<tr><td>Current Game Name:<td></td><td>  ' . $_POST['aa_name'] . '</td></tr>
<tr><td>Age:<td></td><td>  ' . $_POST['age'] . '</td></tr>
<tr><td>Gender: <td></td><td>' . $_POST['gender'] . '</td></tr>
<tr><td>Location:<td></td><td>  ' . $_POST['location'] . '</td></tr>
<tr><td>Current Honor: <td></td><td> ' . $_POST['honor'] . '</td></tr>
<tr><td>Previous clan(s): <td></td><td> ' . $_POST['prev_clans'] . '</td></tr>
<tr><td>Banned from any sever: <td></td><td> ' . $_POST['banned'] . '</td></tr>
<tr><td>Registered with AAOTracker? <td></td><td>' . $_POST['aaotracker'] . '</td></tr>
<tr><td>AAOTracker name:  <td></td><td>' . $_POST['aaotracker_name'] . '</td></tr>
<tr><td>Registred with X-fire? <td></td><td> ' . $_POST['xfire'] . '</td></tr>
<tr><td>X-Fire Account: <td></td><td> ' . $_POST['xfire_name'] . '</td></tr>
<tr><td>TeamSpeak installed?: <td></td><td> ' . $_POST['ts'] . '</td></tr>
<tr><td>Have microphone/headset: <td></td><td> ' . $_POST['mic'] . '</td></tr>
<tr><td>Would like to help pay for a server?:<td></td><td> ' . $_POST['pay'] . '</td></tr>
<tr><td>Why do you want to join our clan? <td></td><td> ' . $_POST['why'] . '</td></tr>
<tr><td>Gaming habbits: <td></td><td> ' . $_POST['habbits'] . '</td></tr>
<tr><td>Other information: <td></td><td> ' . $_POST['other']. '</td></tr>
</table>';


Yours needs to be like this (you need to change back all the questions to yours)

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'
[table]
[tr][td]Real Name:[/td][td] ' . $_POST['real_name'] . '[/td][/tr]
[tr][td]Email address:[/td][td] ' . $_POST['email'] . '[/td][/tr]
[tr][td]Current Game Name:[/td][td] ' . $_POST['aa_name'] . '[/td][/tr]
[tr][td]Age:[/td][td] ' . $_POST['age'] . '[/td][/tr]
[tr][td]Gender:[/td][td] ' . $_POST['gender'] . '[/td][/tr]
[tr][td]Location:[/td][td] ' . $_POST['location'] . '[/td][/tr]
[tr][td]Current Level:[/td][td] ' . $_POST['honor'] . '[/td][/tr]
[tr][td]Previous Guild(s):[/td][td] ' . $_POST['prev_clans'] . '[/td][/tr]
[tr][td]Class:[/td][td] ' . $_POST['banned'] . '[/td][/tr]
[tr][td]Do you have raiding experience[/td][td] ' . $_POST['aaotracker'] . '[/td][/tr]
[tr][td]Describe that experience:[/td][td] ' . $_POST['aaotracker_name'] . '[/td][/tr]
[tr][td]Do you have any professions[/td][td] ' . $_POST['xfire'] . '[/td][/tr]
[tr][td]Which Professions(include skill):[/td][td] ' . $_POST['xfire_name'] . '[/td][/tr]
[tr][td]Ventrilo installed?:[/td][td] ' . $_POST['ts'] . '[/td][/tr]
[tr][td]Have microphone/headset:[/td][td] ' . $_POST['mic'] . '[/td][/tr]
[tr][td]Have you read our guild Constitution and Charter:[/td][td] ' . $_POST['pay'] . '[/td][/tr]
[tr][td]Why do you want to join our Guild[/td][td] ' . $_POST['why'] . '[/td][/tr]
[tr][td]Do you know anyone in Affliction:[/td][td] ' . $_POST['habbits'] . '[/td][/tr]
[tr][td]Other information:[/td][td] ' . $_POST['other']. '[/td][/tr]
[/table]';


That fixes both spacing and editing issues.


QuoteEDIT
hairy what theme is that?
You mean my site? You like it?? I converted it from an existing theme :)
QuoteTheme Pirates By Aku | Converted To America's Army By =SAMS=Hairy

Cheers

CampCounselor

#195
would be wondering if we could use it?

edit
worked like a charm. thanks!

tc3driver

#196
A while ago I took some of the snippets here and have since made my own version according to my guilds needs, I thought I would share.

the Form.
Code (php) Select

<? php

global $sourcedir, $user_info, $context ;

require_once($sourcedir . '/Subs.php');
require_once($sourcedir .'/Subs-Post.php');
if (empty($context['user']['name'])){
     header('location: http://fatalfury.digitalmalice.com/?page=9');
}

// CONFIGURATION SECTION

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

// email address of recruitment staff member
$email_address=array('email1@email.com', 'email2@email.com', 'email3@email.com') ;

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

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

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

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


//END OF CONFIGURATION SECTION

if (isset($_POST['submitted'])) {
// Handle the form

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

        // Check that user is logged in
if (empty($context['user']['name'])){
                $enrole_errors[] = 'You must <a href="?action=login">login</a> or <a href="?action=register">register</a> before you can apply.';
        }

// Check for a name
if (empty($_POST['First_name']) ){
$enroll_errors[] = 'You forgot to enter your First name.';
}
if (empty($_POST['Last_name']) ){
$enroll_errors[] = 'You forgot to enter your Last name.';
        }
// Check for an email
if (empty($_POST['email']) ){
$enroll_errors[] = 'You forgot to enter your email address.';
}
// Check for an AA name
if (empty($_POST['cname']) ){
$enroll_errors[] = 'You forgot to enter your In-Game Nickname.';
}       
// Check for an age
if (empty($_POST['age']) ){
$enroll_errors[] = 'You forgot to enter your age.';

if ($_POST['Make']=='-1'){
$enroll_errors[] = 'You need to define your race';
}
if (empty($enroll_errors)) { //Everything seems to be OK
     
        $show_form='false';



// email an application
if ($_POST['Make']=='1'){
$race='Blood Elf';
}
elseif ($_POST['Make']=='2'){
$race='Orc';
}
elseif ($_POST['Make']=='3'){
$race='Tauren';
}
elseif ($_POST['Make']=='4'){
$race='Troll';
}
elseif ($_POST['Make']=='5'){
$race='Undead';
}
$subject = 'Enrollment Application for Fatal Fury';
$body = 'Enrollment application has been made by ' . $context['user']['name'] . 
' from IP Address ' . $user_info['ip'] . '
Personal Information:
---------------------------------
Real Name:  ' . $_POST['First_name'] .' '. $_POST['Last_name']. '
Email address:  ' . $_POST['email'] . '
Age:  ' . $_POST['age'] . '
Gender: ' . $_POST['gender'] . '
Location:  ' . $_POST['location'] . '

Player Character Information:
----------------------------------
Toon Name:  ' . $_POST['cname'] . '
Current Level:  ' . $_POST['lvl'] . '
Previous Guild(s):  ' . $_POST['prev_clans'] . '
Race: ' . $race  . '
Class:  ' . $_POST['clas'] . '
Attunments: ' . $_POST['attun'] . '
Do you have raiding experience ' . $_POST['raid_exp'] . '
Describe that experience:  ' . $_POST['raid_exp_disc'] . '
Primary Profession 1:  ' . $_POST['profession_1_lvl'] .' '. $_POST['profession_1'] . '
Primary Profession 2:  ' . $_POST['profession_2_lvl'] .' '. $_POST['profession_2'] . '
Cooking Level:  ' . $_POST['cooking'] . '
First Aid Level:  ' . $_POST['first_aid'] . '
Fishing Level:  ' . $_POST['fishing'] . '

Vent Usability
----------------------------------
Ventrilo installed?:  ' . $_POST['vent'] . '
Have microphone/headset:  ' . $_POST['mic'] . '

Playing times:
---------------------------------
Monday: '. $_POST['mon_start'] .' - '. $_POST['mon_finish'] .'
Tuesday: '. $_POST['tue_start'] .' - '. $_POST['tue_finish'] .'
Wednesday: '. $_POST['wed_start'] .' - '. $_POST['wed_finish'] .'
Thursday: '. $_POST['thu_start'] .' - '. $_POST['thu_finish'] .'
Friday: '. $_POST['fri_start'] .' - '. $_POST['fri_finish'] .'
Saturday: '. $_POST['sat_start'] .' - '. $_POST['sat_finish'] .'
Sunday: '. $_POST['sun_start'] .' - '. $_POST['sun_finish'] .'

Other Information:
---------------------------------
Why do you want to join our Guild  ' . $_POST['why'] . '
Do you know anyone in Fatal Fury:   ' . $_POST['friend'] . '
How did you find our site: ' . $_POST['how'] . '
How often do you visit our web site: ' . $_POST['visit'] . '
Other information:  ' . $_POST['other'];

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'
[table]
[tr][td][b][color=#f0ba00]Personal Information:[/color][/b][/td][/tr]
[tr][td][color=#f0ba00]real Name:[/color][/td][td]  ' . $_POST['First_name'] .' '. $_POST['Last_name']. '[/td][/tr]
[tr][td][color=#f0ba00]Email address:[/color][/td][td]  ' . $_POST['email'] . '[/td][/tr]
[tr][td][color=#f0ba00]Age:[/color][/td][td]  ' . $_POST['age'] . '[/td][/tr]
[tr][td][color=#f0ba00]Gender:[/color][/td][td] ' . $_POST['gender'] . '[/td][/tr]
[tr][td][color=#f0ba00]Location:[/color][/td][td]  ' . $_POST['location'] . '[/td][/tr]
[tr][td][color=#f0ba00][b]Player Character Information:[/b][/color][/td][/tr]
[tr][td][color=#f0ba00]Toon Name:[/color][/td][td]  ' . $_POST['cname'] . '[/td][/tr]
[tr][td][color=#f0ba00]Current Level:[/color][/td][td]  ' . $_POST['lvl'] . '[/td][/tr]
[tr][td][color=#f0ba00]Previous Guild(s):[/color][/td][td]  ' . $_POST['prev_clans'] . '[/td][/tr]
[tr][td][color=#f0ba00]Race:[/color][/td][td] ' . $race . '[/td][/tr]
[tr][td][color=#f0ba00]Class:[/color][/td][td]  ' . $_POST['clas'] . '[/td][/tr]
[tr][td][color=#f0ba00]Attunments:[/color][/td][td] ' . $_POST['attun'] . '[/td][/tr]
[tr][td][color=#f0ba00]Do you have raiding experience:[/color][/td][td] ' . $_POST['raid_exp'] . '[/td][/tr]
[tr][td][color=#f0ba00]Describe that experience:[/color][/td][td]  ' . $_POST['raid_exp_disc'] . '[/td][/tr]
[tr][td][color=#f0ba00]Primary Profession 1:[/color][/td][td]  ' . $_POST['profession_1_lvl'] .' '.  $_POST['profession_1'] . '[/td][/tr]
[tr][td][color=#f0ba00]Primary Profession 2:[/color][/td][td]  ' . $_POST['profession_2_lvl'] .' '.  $_POST['profession_2'] . '[/td][/tr]
[tr][td][color=#f0ba00]Cooking Level:[/color][/td][td]  ' . $_POST['cooking'] . '[/td][/tr]
[tr][td][color=#f0ba00]First Aid Level:[/color][/td][td]  ' . $_POST['first_aid'] . '[/td][/tr]
[tr][td][color=#f0ba00]Fishing Level:[/color][/td][td]  ' . $_POST['fishing'] . '[/td][/tr]
[tr][td][color=#f0ba00][b]Vent Usability:[/b][/color][/td][/tr]
[tr][td][color=#f0ba00]Ventrilo installed?:[/color][/td][td]  ' . $_POST['vent'] . '[/td][/tr]
[tr][td][color=#f0ba00]Have microphone/headset:[/color][/td][td]  ' . $_POST['mic'] . '[/td][/tr]
[tr][td][color=#f0ba00][b]Playing times:[/b][/color][/td][/tr]
[tr][td][color=#f0ba00]Monday:[/color][/td][td] '. $_POST['mon_start'] .' - '. $_POST['mon_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00]Tuesday:[/color][/td][td] '. $_POST['tue_start'] .' - '. $_POST['tue_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00]Wednesday:[/color][/td][td] '. $_POST['wed_start'] .' - '. $_POST['wed_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00]Thursday:[/color][/td][td] '. $_POST['thu_start'] .' - '. $_POST['thu_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00]Friday:[/color][/td][td] '. $_POST['fri_start'] .' - '. $_POST['fri_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00]Saturday:[/color][/td][td] '. $_POST['sat_start'] .' - '. $_POST['sat_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00]Sunday:[/color][/td][td] '. $_POST['sun_start'] .' - '. $_POST['sun_finish'] .'[/td][/tr]
[tr][td][color=#f0ba00][b]Other Information:[/b][/color][/td][/tr]
[tr][td][color=#f0ba00]Why do you want to join our Guild:[/color][/td][td]  ' . $_POST['why'] . '[/td][/tr]
[tr][td][color=#f0ba00]Do you know anyone in Fatal Fury:[/color][/td][td]   ' . $_POST['friend'] . '[/td][/tr]
[tr][td][color=#f0ba00]How did you find our site:[/color][/td][td] ' . $_POST['how'] . '[/td][/tr]
[tr][td][color=#f0ba00]How often do you visit our web site:[/color][/td][td] ' . $_POST['visit'] . '[/td][/tr]
[tr][td][color=#f0ba00]Other information:[/color][/td][td]   ' . $_POST['other'] .'[/td][/tr]
[/table]';



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


//create new forum post with application

$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,
);
   
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 name="main" 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"><th colspan=2>Personal Information</th></tr>
<TR class ="windowbg">
<TD width = "200px">* Your First Name:</TD>
<TD><INPUT id="First_name" name="First_name" type="text" value =""';
if (isset($_POST['First_Name'])) echo $_POST['First_name'];
echo '" /></TD>
</TR>
                        <TR class ="windowbg">
                                <TD width = "200px">* Your Last Name:</TD>
                                <TD><INPUT id="Last_name" name="Last_name" type="text" value =""';
if (isset($_POST['Last_Name'])) echo $_POST['Last_name'];
echo '" /></TD>
                        </TR>

<TR class ="windowbg">
<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">* Age:</TD>
                                <TD><INPUT id="age" name="age" type="text" value ="';
if (isset($_POST['age'])) echo $_POST['age'];
echo '" /></TD>
                        </TR>
<TR class ="windowbg">
                                <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="M">Male</OPTION>
                                                <OPTION value="F">Female</OPTION>
                                        </SELECT></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="windowbg"><th colspan=2>Player Character Infromation</th></tr>
<TR class ="windowbg">
<TD width = "200px">* Name of Character applying:</TD>
<TD><INPUT id="cname" name="cname" type="text" value ="';
if (isset($_POST['cname'])) echo $_POST['cname'];
echo '" /></TD>
</TR>
<TR class ="windowbg">
                                <TD width = "200px">Current Level:</TD>
                                <TD><select id="lvl" name="lvl" type="text" value ="';
if (isset($_POST['lvl'])) echo $_POST['lvl'];
echo '" />
                                <option value="No Answer">--</option>';
                        for($i=1; $i<71; $i++){
                                echo'
                                <option value="'. $i .'">'. $i .'</option>';
                        }
                        echo '
                        </TD>
                        </TR>
<tr class="windowbg">
<td>Previous Guilds:</td>
<td><input type="text" name="prev_clans" value="';
if (isset($_POST['prev_clans'])) echo $_POST['prev_clans'];
echo '"></td>
</tr>
<tr class="windowbg">
<td>Race: </td>
<td><select name="Make" id="Make" onchange="fillSelectFromArray(this.form.clas, ((this.selectedIndex == -1) ? null : race[this.selectedIndex-1]));">
<option value="-1">Select Race</option>
<option value="1">Blood Elf</option>
<option value="2">Orc</option>
<option value="3">Tauren</option>
<option value="4">Troll</option>
<option value="5">Undead</option>
</select></td>
</tr>
<tr class="windowbg">
<td>Class:</td>
<td><select name="clas" size="6">
<option>                                  </option>
<option>                                  </option>
<option>                                  </option>
<option>                                  </option>
<option>                                  </option>
<option>                                  </option>
</select></td>
</tr>
<tr class="windowbg">
<td>List your attunments:</td>
<td><textarea name="attun" cols="20" rows="6">'; if (isset($_POST['attun'])) echo $_POST['attun'];
echo '</textarea></td>
</tr>
<TR class ="windowbg">
<TD width = "200px">Do you have raiding experience</TD>
<TD><SELECT id="raid_exp" name="raid_exp" style="WIDTH: 160px" value ="';
if (isset($_POST['raid_exp'])) echo $_POST['raid_exp'];   
echo '">
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Describe that experience:</TD>
<TD><textarea id="" name="raid_exp_disc" type="text" value ="';
if (isset($_POST['raid_exp_disc'])) echo $_POST['raid_exp_disc']; 
echo '" ></textarea></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">First Primary Profession:</TD>
<TD><SELECT id="profession_1_llv" name="profession_1_lvl" value ="';
if (isset($_POST['profession_1_lvl'])) echo $_POST['profession_1_lvl']; 
echo '">

<OPTION value="No answer" selected>---</OPTION>';
for($p1l=1; $p1l<376; $p1l++){
echo '<option value="'. $p1l .'">'. $p1l .'</option>';
}
echo '</SELECT>&nbsp;<select name="profession_1">
<option value="No Answer">--------------------------</option>
<option value="Alchemy">Alchemy</option>
<option value="Black Smith">Black Smith</option>
<option value="Enchanting">Enchanting</option>
<option value="Engineering">Engineering</option>
<option value="Herbalism">Herbalism</option>
<option value="Jewlcrafting">Jewlcrafting</option>
<option value="Leather Working">Leather Working</option>
<option value="Minning">Minning</option>
<option value="Skinner">Skinner</option>
<option value="Tailor">Tailor</option>
</select>
</TD>
</TR>
                                <TD class="windowbg" width = "200px">Second Primary Profession:</TD>
                                <TD class="windowbg"><SELECT id="profession_2_llv" name="profession_2_lvl" value ="';
if (isset($_POST['profession_2_lvl'])) echo $_POST['profession_2_lvl'];
echo '" />

                                                <OPTION value="No answer" selected>---</OPTION>';
                                        for($p2l=1; $p2l<376; $p2l++){
                                                echo '<option value="'. $p2l .'">'. $p2l .'</option>';
                                        }
                                        echo '</SELECT>&nbsp;<select name="profession_2">
                                                <option value="No Answer">--------------------------</option>
                                                <option value="Alchemy">Alchemy</option>
                                                <option value="Black Smith">Black Smith</option>
                                                <option value="Enchanting">Enchanting</option>
                                                <option value="Engineering">Engineering</option>
                                                <option value="Herbalism">Herbalism</option>
                                                <option value="Jewlcrafting">Jewlcrafting</option>
                                                <option value="Leather Working">Leather Working</option>
                                                <option value="Minning">Minning</option>
                                                <option value="Skinner">Skinner</option>
                                                <option value="Tailor">Tailor</option>
                                        </select>
                                </TD>
                        </TR>
<tr class="windowbg">
<td>Cooking Level:</td>
<td><SELECT id="cooking" name="cooking" value ="';
if (isset($_POST['cooking'])) echo $_POST['cooking'];
echo '" />

                                                <OPTION value="No answer" selected>---</OPTION>';
                                        for($cl=1; $cl<376; $cl++){
                                                echo '<option value="'. $cl .'">'. $cl .'</option>';
                                        }
                                        echo '</SELECT></td>
</tr>
                        <tr class="windowbg">
                                <td>First Aid Level:</td>
                                <td><SELECT id="first_aid" name="first_aid" value ="';
if (isset($_POST['first_aid'])) echo $_POST['first_aid'];
echo '" />

                                                <OPTION value="No answer" selected>---</OPTION>';
                                        for($fal=1; $fal<376; $fal++){
                                                echo '<option value="'. $fal .'">'. $fal .'</option>';
                                        }
                                        echo '</SELECT></td>
                        </tr>
                        <tr class="windowbg">
                                <td>Fishing Level:</td>
                                <td><SELECT id="fishing" name="fishing" value ="';
if (isset($_POST['fishing'])) echo $_POST['fishing'];
echo '" />

                                                <OPTION value="No answer" selected>---</OPTION>';
                                        for($fl=1; $fl<376; $fl++){
                                                echo '<option value="'. $fl .'">'. $fl .'</option>';
                                        }
                                        echo '</SELECT></td>
                        </tr>
<tr class="windowbg">
<th colspan="2">Ventrillo</td>
</tr>
<TR class ="windowbg">
<TD width = "200px">Do you have the ability to install and/or use Ventrilo?:</TD>
<TD><SELECT id="vent" name="vent" style="WIDTH: 160px" value ="';
if (isset($_POST['vent'])) echo $_POST['vent'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Do you have microphone/headset:</TD>
<TD><SELECT id="mic" name="mic" style="WIDTH: 160px" value ="';
if (isset($_POST['mic'])) echo $_POST['mic'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<tr class="windowbg">
<th colspan="2">Playing Times</th>
</tr>
<tr class="windowbg">
<td colspan="2">Please note that all times are server, and in 24 hour format.</td>
</tr>
<tr class="windowbg">
<td>Monday:</td>
<td><select name="mon_start">';
for($mst=0; $mst<24; $mst++){
echo '
<option value="'. $mst .':00">'. $mst .':00</option>
<option value="'. $mst .':30">'. $mst .':30</option>';
}
echo '</select> - <select name="mon_finish">';
                                for($mft=0; $mft<24; $mft++){
                                        echo '
                                        <option value="'. $mft .':00">'. $mft .':00</option>
                                        <option value="'. $mft .':30">'. $mft .':30</option>';
                                }
                                echo '</select></td>
</tr>
                        <tr class="windowbg">
                                <td>Tuesday:</td>
                                <td><select name="tue_start">';
                                for($tust=0; $tust<24; $tust++){
                                        echo '
                                        <option value="'. $tust .':00">'. $tust .':00</option>
                                        <option value="'. $tust .':30">'. $tust .':30</option>';
                                }
                                echo '</select> - <select name="tue_finish">';
                                for($tuft=0; $tuft<24; $tuft++){
                                        echo '
                                        <option value="'. $tuft .':00">'. $tuft .':00</option>
                                        <option value="'. $tuft .':30">'. $tuft .':30</option>';
                                }
                                echo '</select></td>
                        </tr>
                        <tr class="windowbg">
                                <td>Wednesday:</td>
                                <td><select name="wed_start">';
                                for($wst=0; $wst<24; $wst++){
                                        echo '
                                        <option value="'. $wst .':00">'. $wst .':00</option>
                                        <option value="'. $wst .':30">'. $wst .':30</option>';
                                }
                                echo '</select> - <select name="wed_finish">';
                                for($wft=0; $wft<24; $wft++){
                                        echo '
                                        <option value="'. $wft .':00">'. $wft .':00</option>
                                        <option value="'. $wft .':30">'. $wft .':30</option>';
                                }
                                echo '</select></td>
                        </tr>
                        <tr class="windowbg">
                                <td>Thursday:</td>
                                <td><select name="thu_start">';
                                for($thst=0; $thst<24; $thst++){
                                        echo '
                                        <option value="'. $thst .':00">'. $thst .':00</option>
                                        <option value="'. $thst .':30">'. $thst .':30</option>';
                                }
                                echo '</select> - <select name="thu_finish">';
                                for($thft=0; $thft<24; $thft++){
                                        echo '
                                        <option value="'. $thft .':00">'. $thft .':00</option>
                                        <option value="'. $thft .':30">'. $thft .':30</option>';
                                }
                                echo '</select></td>
                        </tr>
                        <tr class="windowbg">
                                <td>Friday:</td>
                                <td><select name="fri_start">';
                                for($fst=0; $fst<24; $fst++){
                                        echo '
                                        <option value="'. $fst .':00">'. $fst .':00</option>
                                        <option value="'. $fst .':30">'. $fst .':30</option>';
                                }
                                echo '</select> - <select name="fri_finish">';
                                for($fft=0; $fft<24; $fft++){
                                        echo '
                                        <option value="'. $fft .':00">'. $fft .':00</option>
                                        <option value="'. $fft .':30">'. $fft .':30</option>';
                                }
                                echo '</select></td>
                        </tr>
                        <tr class="windowbg">
                                <td>Saturday:</td>
                                <td><select name="sat_start">';
                                for($sast=0; $sast<24; $sast++){
                                        echo '
                                        <option value="'. $sast .':00">'. $sast .':00</option>
                                        <option value="'. $sast .':30">'. $sast .':30</option>';
                                }
                                echo '</select> - <select name="sat_finish">';
                                for($saft=0; $saft<24; $saft++){
                                        echo '
                                        <option value="'. $saft .':00">'. $saft .':00</option>
                                        <option value="'. $saft .':30">'. $saft .':30</option>';
                                }
                                echo '</select></td>
                        </tr>
                        <tr class="windowbg">
                                <td>Sunday:</td>
                                <td><select name="sun_start">';
                                for($sust=0; $sust<24; $sust++){
                                        echo '
                                        <option value="'. $sust .':00">'. $sust .':00</option>
                                        <option value="'. $sust .':30">'. $sust .':30</option>';
                                }
                                echo '</select> - <select name="sun_finish">';
                                for($suft=0; $suft<24; $suft++){
                                        echo '
                                        <option value="'. $suft .':00">'. $suft .':00</option>
                                        <option value="'. $suft .':30">'. $suft .':30</option>';
                                }
                                echo '</select></td>
                        </tr>

<tr class="windowbg">
<th colspan="2">Other Information</th>
</td>
<TR class ="windowbg">
<TD width = "200px">Why do you want to join Fatal Fury</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 ="windowbg">
<TD width = "200px">Do you know anyone in Fatal Fury:
</TD>
<TD><TEXTAREA id="friend" name="friend" rows="4" cols="40" value ="';
if (isset($_POST['friend'])) echo $_POST['freind'];
echo '" ></' . 'TEXTAREA></TD>
</TR>
<tr class="windowbg">
<td>How did you find our site?:</td>
<td><select name="how">
<option value="No Answer">-------------------</option>
<option value="search">Search Engine (google, etc)</option>
<option value="friend">Friend reccomended</option>
<option value="other method">Other</option
</select></td>
</tr>
<tr class="windowbg">
<td>How often do you visit our site?:</td>
<td><select name="visit">
<option value="First Visit">First Visit</option>
<option value="Daily">Daily</option>
<option value="weekly">Weekly</option>
<option value="monthly">Montly</option>
<option value="yearly">Yearly</option>
</select></td>
</tr>
<TR class ="windowbg">
<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>
';
?>


Note that I added a requirement for the applicant to have a valid user account to even see the application.
Note the e-mail portion is now an array.
Note the addition of java script for the race and class.

here is the java script that I used:

race = new Array(
new Array(
new Array("Hunter", "Hunter"),
new Array("Mage", "Mage"),
new Array("Paladin", "Paladin"),
new Array("Priest", "Priest"),
new Array("Rogue", "Rogue"),
new Array("Warlock", "Warlock")
),
new Array(
new Array("Hunter", "Hunter"),
new Array("Rogue", "Rogue"),
new Array("Shaman", "Shaman"),
new Array("Warrior", "Warrior"),
new Array("Warlock", "Warlock")
),
new Array(
new Array("Druid", "Druid"),
new Array("Hunter", "Hunter"),
new Array("Shaman", "Shaman"),
new Array("Warrior", "Warrior")
),
new Array(
new Array("Hunter", "Hunter"),
new Array("Mage", "Mage"),
new Array("Priest", "Priest"),
new Array("Rogue", "Rogue"),
new Array("Shaman", "Shaman"),
new Array("Warrior", "Warrior")
),
new Array(
new Array("Mage", "Mage"),
new Array("Priest", "Priest"),
new Array("Rogue", "Rogue"),
new Array("Warrior", "Warrior"),
new Array("Warlock", "Warlock")
)
);
function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
var i, j;
var prompt;
// empty existing items
for (i = selectCtrl.options.length; i >= 0; i--) {
selectCtrl.options[i] = null;
}
prompt = (itemArray != null) ? goodPrompt : badPrompt;
if (prompt == null) {
j = 0;
}
else {
selectCtrl.options[0] = new Option(prompt);
j = 1;
}
if (itemArray != null) {
// add new items
for (i = 0; i < itemArray.length; i++) {
selectCtrl.options[j] = new Option(itemArray[i][0]);
if (itemArray[i][1] != null) {
selectCtrl.options[j].value = itemArray[i][1];
}
j++;
}
// select first item (prompt) for sub list
selectCtrl.options[0].selected = true;
   }
}

Note that this is a separate file which I put in it's own directory "Dropdown/dropdown.js"

and in your "Themes/{currenttheme}/index.template.php" file you will need to add the location of that dropdown JS between the <head> and the </head>


<script type="text/javascript" src="Dropdown/dropdown.js"></script>

CampCounselor

I am getting problems.
Quote
Parse error: syntax error, unexpected T_GLOBAL in C:\xampp\htdocs\ACE\dropdown.php on line 4

tc3driver

if you are trying to implement the Dropdown Java Script (I cannot tell but am guessing that you are).

That should be named "dropdown.js" by giving it a php extension your server is trying to parse it as php, and it is not php it is java script.

CampCounselor

i put the code in for the article in a php file. and in the article i put in

include("dropdown.php");

This website is proudly hosted on Crocweb Cloud Website Hosting.