Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
Donovan
Client


Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Sun Dec 07, 2003 4:30 pm Reply with quote

With the help of [MC] Tomcat over at [MC] Gamers, I made a recruitment module that is a hack off the feedback module.

Code:


<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

/**********************************/
/* Configuration                  */
/*                                */
/* You can change this:           */
/* $index = 0; (right side off)   */
/**********************************/
$index = 1;
$subject = "$sitename "._FEEDBACK."";
/**********************************/

include("header.php");

if ($cookie[1] != "") {
    $sql = "SELECT name, username, user_email FROM ".$user_prefix."_users WHERE user_id='$cookie[0]'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    if ($row[name] != "") {
   $sender_name = $row[name];
    } else {
   $sender_name = $row[username];
    }
    $sender_email = $row[user_email];
}

$block="<html> \n"
      ."<head> \n"
      ."<title>Recruitment</title> \n"
      ."<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"> \n"
      ."</head> \n"
      ."\n"
      ."<body bgcolor=\"#CCCCCC\"><table width=\"100%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\" > \n"
      ."<tr><td> \n"
      ."\n"
      ."      <center><b><font color=\"#FF0000\" face=\"Army, Army Condensed, Army Expanded, Army Hollow, Army Thin, Army Wide\"><h2>3rd Infantry Division Application Form</h2></font></b></center> \n"
      ."     <font color=\"#000000\" face=\"Army, Army Condensed, Army Expanded, Army Hollow, Army Thin, Army Wide\"><br> \n"
      ."      <br><center>If you want to be a Marne Soldier...<br> \n"
      ."            If you have the heart and the courage...<br> \n"
      ."             The commitment and the dedication...<br> \n"
      ."           To have fun, then we're the Unit for you! \n"
      ."   </center></font> \n"
      ."\n"
      ."<FORM METHOD=\"post\" ACTION=\"modules.php?name=Application_Form\"> \n"
      ."      <font color=\"#FFFFFF\"> \n"
      ."      <INPUT type=\"hidden\" name=\"opi\" value=\"ds\"> \n"
      ."      </font> \n"
      ."      <TABLE BORDER=\"0\" WIDTH=\"100%\"> \n"
      ."        <TR> \n"
      ."          <TD COLSPAN=\"2\" ALIGN=\"CENTER\"> <font color=\"#FFFFFF\" class=\"content\">Please \n"
      ."            provide the following contact information:</font><font color=\"#FFFFFF\">&nbsp; \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD ALIGN=\"RIGHT\" WIDTH=\"50%\"> <font color=\"#FFFFFF\"><b>Please provide \n"
      ."            your real name:</b><br> \n"
      ."            </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\" WIDTH=\"50%\"> <font color=\"#FFFFFF\"> \n"
      ."            <INPUT type=\"text\" NAME=\"sender_name\" VALUE=\"\" SIZE=30> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD ALIGN=\"RIGHT\"> <font color=\"#FFFFFF\"><b>Please provide your Call \n"
      ."            of Duty name:</b><br> \n"
      ."            </font></TD> \n"
      ."          <TD> <font color=\"#FFFFFF\"> \n"
      ."            <INPUT type=\"text\" NAME=\"sender_callsign\" VALUE=\"\" SIZE=30> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD ALIGN=\"RIGHT\"> <font color=\"#FFFFFF\"><b>Please provide an email \n"
      ."            address you can be reached at :</b><br> \n"
      ."            <FONT SIZE=\"-2\"><B>Please, do not enter a @hotmail.com account ! !</B></FONT></font> \n"
      ."          </TD> \n"
      ."          <TD> <font color=\"#FFFFFF\"> \n"
      ."            <INPUT type=\"text\" NAME=\"sender_email\" VALUE=\"\" SIZE=30> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD ALIGN=\"right\"> <font color=\"#FFFFFF\">Where are you located geographically \n"
      ."            *: </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\"> <font color=\"#FFFFFF\"> \n"
      ."            <select NAME=\"Location\" size=\"1\"> \n"
      ."              <OPTION>USA</OPTION> \n"
      ."              <OPTION>Canada</OPTION> \n"
      ."              <OPTION>Europe</OPTION> \n"
      ."              <OPTION>Asia</OPTION> \n"
      ."            </select> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD ALIGN=\"right\"> <font color=\"#FFFFFF\"><b>Primary weapon of choice</b>: \n"
      ."            </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\"> <font color=\"#FFFFFF\"><B> \n"
      ."            <SELECT NAME=\"firstweapon\"> \n"
      ."              <OPTION VALUE=\"---\">Pick One</OPTION> \n"
      ."              <OPTION VALUE=\"M1 Garand\">M1 Garand</OPTION> \n"
      ."              <OPTION VALUE=\"M1 Carbine\">M1 Carbine</OPTION> \n"
      ."              <OPTION VALUE=\"Thompson SMG M1A1\">Thompson SMG M1A1</OPTION> \n"
      ."              <OPTION VALUE=\"Browning Automatic Rifle (BAR) M1918A2\">Browning \n"
      ."              Automatic Rifle (BAR) M1918A2</OPTION> \n"
      ."            </SELECT> \n"
      ."            </B> </font></TD> \n"
      ."        </TR> \n"
      ."      </table> \n"
      ."      <table> \n"
      ."        <TR> \n"
      ."          <TD VALIGN=\"MIDDLE\" ALIGN=\"right\"> <font color=\"#FFFFFF\"><b>Have you \n"
      ."            ever been in a realism unit before</b>: </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\"> <font color=\"#FFFFFF\"> \n"
      ."            <INPUT TYPE=\"RADIO\" NAME=\"claned\" VALUE=\"Yes\" CHECKED> \n"
      ."            Yes&nbsp;&nbsp; \n"
      ."            <INPUT TYPE=\"RADIO\" NAME=\"claned\" VALUE=\"No\"> \n"
      ."            No </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD VALIGN=\"TOP\" ALIGN=\"right\"> <font color=\"#FFFFFF\"><b>Why do you \n"
      ."            play Call of Duty?</b> </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\"> <font color=\"#FFFFFF\"> \n"
      ."            <TEXTAREA NAME=\"whyplay\" ROWS=\"5\" COLS=\"35\"></TEXTAREA> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD VALIGN=\"TOP\" ALIGN=\"right\"> <font color=\"#FFFFFF\"><b>What skill, \n"
      ."            talent or other item will you bring to the unit?</b> </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\"> <font color=\"#FFFFFF\"> \n"
      ."            <TEXTAREA NAME=\"Skills_Talents\" ROWS=\"5\" COLS=\"35\"></TEXTAREA> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD VALIGN=\"TOP\" ALIGN=\"right\"> <font color=\"#FFFFFF\"><b>Any additional \n"
      ."            comments or things we should know?</b> </font></TD> \n"
      ."          <TD ALIGN=\"LEFT\"> <font color=\"#FFFFFF\"> \n"
      ."            <TEXTAREA NAME=\"Additional\" ROWS=\"5\" COLS=\"35\"></TEXTAREA> \n"
      ."            </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD VALIGN=\"MIDDLE\" ALIGN=\"right\" WIDTH=\"40%\"> <font color=\"#FFFFFF\"><b>Are \n"
      ."            you willing to wear the [3rd ID] tag after your name at all times?</b>: \n"
      ."            </font></TD> \n"
      ."          <TD ALIGN=\"left\"> <font color=\"#FFFFFF\"> \n"
      ."            <INPUT TYPE=\"RADIO\" NAME=\"wearit\" VALUE=\"Yes\" CHECKED> \n"
      ."            Yes&nbsp;&nbsp; \n"
      ."            <INPUT TYPE=\"RADIO\" NAME=\"wearit\" VALUE=\"No\"> \n"
      ."            No </font></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD COLSPAN=\"2\" ALIGN=\"CENTER\"><p><font color=\"#FFFFFF\"> Please note \n"
      ."              that applying does not mean you are in the [3rd ID]. You'll be watched \n"
      ."              closely on the forum and in game on our server for a length of time. \n"
      ."              Stay active on the server and on the forums (cant stress this enough). \n"
      ."              If you display the dedication, commitment, maturity, and will uphold \n"
      ."              the honor of the 3rd Infantry Division, then after this trial period \n"
      ."              will you be given your draft notice and allowed into the 3rd ID. \n"
      ."              Skill alone does not determine admittance, as attitude plays a big \n"
      ."              part in the decision as well. If for some reason you have not received \n"
      ."              a reply to your application within two days, please send an email \n"
      ."              to <a href=\"mailto:\"recruitment@3rd-Infantry-Division.net\">Recruitment[3rd \n"
      ."              ID]</a> and let them know. </font></p> \n"
      ."            <p><font color=\"#FFFFFF\">Good luck Soldier!!</font></p></TD> \n"
      ."        </TR> \n"
      ."        <TR> \n"
      ."          <TD COLSPAN=\"2\" ALIGN=\"CENTER\"> <font color=\"#FFFFFF\"> \n"
      ."            <INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Send\"> \n"
      ."            &nbsp;&nbsp;&nbsp; \n"
      ."            <INPUT TYPE=\"reset\"VALUE=\"Reset\"> \n"
      ."            &nbsp;&nbsp;&nbsp; </font></TD> \n"
      ."        </TR> \n"
      ."      </TABLE> \n"
      ."    </FORM></center> \n"
      ."</body> \n"
      ."</html> \n";



OpenTable();
if ($opi != "ds") {
    echo "$block";
} elseif ($opi == "ds") {
    if ($sender_name == "") {
   $name_err = "<center><font class=\"option\"><b><i>"._FBENTERNAME."</i></b></font></center><br>";
   $send = "no";
    }
    if ($sender_email == "") {
   $email_err = "<center><font class=\"option\"><b><i>"._FBENTEREMAIL."</i></b></font></center><br>";
   $send = "no";
    }
    if ($send != "no") {
   $sender_name = removecrlf($sender_name);
   $sender_email = removecrlf($sender_email);
   $msg = "$sitename\n\n";
   $msg .= ""._SENDERNAME.": $sender_name\n";
   $msg .= ""._SENDEREMAIL.": $sender_email\n";
   $msg .= ""._MESSAGE.": $message\n\n";
   $to = $adminmail;
   $mailheaders = "From: $sender_name <$sender_email>\n";
   $mailheaders .= "Reply-To: $sender_email\n\n";
   mail($to, $subject, $msg, $mailheaders);
   echo "<P><center>"._FBMAILSENT."</center></p>";
   echo "<P><center>"._FBTHANKSFORCONTACT."</center></p>";
    } elseif ($send == "no") {
   OpenTable2();
   echo "$name_err";
   echo "$email_err";
   echo "$message_err";
   CloseTable2();
   echo "<br><br>";
   echo "$block"; 
    }
}

CloseTable();   
include("footer.php");

?>




I get an e-mail reply to the user account but the e-mail doesn't show all the info.

This part of the code:

Code:


  $msg .= ""._SENDERNAME.": $sender_name\n";
   $msg .= ""._SENDEREMAIL.": $sender_email\n";
   $msg .= ""._MESSAGE.": $message\n\n";


...is what I think is the issue.

Below is the only information that appears in the e-mail. Where is the ._MESSAGE information, and why did it not get sent with the e-mail?

3rd Infantry Division

_SENDERNAME: "name of recruit"
_SENDEREMAIL: "e-mail address of recruit"
Message:
 
View user's profile Send private message Visit poster's website ICQ Number
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Sun Dec 07, 2003 9:31 pm Reply with quote

As far as I can tell from your code, there is only 1 reference to $message and it is not assigning $message anything, it only references $message. Where are you assigning $message any content?
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©