Jump to content

Form processing(email)


leoashcraft

Recommended Posts

Ok... I've been working on this a couple days... Decided to look for help.

 

The problem is, when it's submitted, it simply goes to "process.php" and it's a blank page.

 

Everything is pretty straight forward... I've just recently started working with PHP...

But every time I try to mess with it it's just so OVERWHELMING!!! ??? :'(

 

The location of what I'm working on is:

The HTML Form: http://nothingpersonal.darkstargamers.com/application/scform.php

The process.php: http://nothingpersonal.darkstargamers.com/application/process.php

 

I have posted the code for both, scform.php and process.php

 

------------------------------------------

 

This is the complete contents of scform.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<style type="text/css">
body{
color: #000000;
font-family: fantasy;
background-image:url('http://nothingpersonal.darkstargamers.com/application/parchment.jpg');
background-attachment:scroll;
background-repeat:repeat-y;
background-position:center; 
}
INPUT {
background-color: #CDC0B0;
color: black;
}
select {
background-color: CDC0B0;
border: A39480 0px solid;
color: black;
}
option {
background-color: CDC0B0;
border: A39480 0px solid;
color: black;
}
TEXTAREA {
background-color: CDC0B0;
border: A39480 0px solid;
color: black;
}

.altButtonFormat {
background-color: #CDC0B0;
font-family: verdana;
border: #000000 0px solid;
color: black;
}

.altTextField {
background-color: #CDC0B0;
color: black;
}

.radioStyle {
background-color: #CDC0B0;
border: #A39480 solid 1px;
color: #000000
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Description" content="Contact Page">
<title>Guild Application</TITLE>
</head>
<body bgcolor="black">
<div align="center"><img src="http://nothingpersonal.darkstargamers.com/forum/Themes/IronWoW/images/wow.jpg"></div>
<div align="center">
<form action="process.php" method="post">
<table>
<tr><td><br><br><h2>Character Information</h2></td><td></td></tr>
<tr>
	<td align="right">Your Character's Name:</td>
	<td><input type=text name="charname" value=""><br></td>
</tr>
	<tr>
		<td align="right">Race:</td>
		<td><select  name="race"  style=""><option value="" selected ></option>
<option value="Blood Elf"  >Blood Elf</option>

<option value="Draenei"  >Draenei</option>
<option value="Dwarf"  >Dwarf</option>
<option value="Gnome"  >Gnome</option>
<option value="Human"  >Human</option>
<option value="Night Elf"  >Night Elf</option>
<option value="Orc"  >Orc</option>
<option value="Tauren"  >Tauren</option>
<option value="Troll"  >Troll</option>
<option value="Undead"  >Undead</option>

</select><br></td>
	</tr>
	<tr>
		<td align="right">Class:</td>
		<td><select  name="class"  style=""><option value="" selected ></option>
<option value="Death Knight"  >Death Knight</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="Shaman"  >Shaman</option>
<option value="Warlock"  >Warlock</option>
<option value="Warrior"  >Warrior</option>
</select></td>
	</tr><br>
	<tr>

		<td align="right">Level:</td>
		<td><select  name="level"  style=""><option value="Level 1"  >1</option>
<option value="Level 2"  >2</option>
<option value="Level 3"  >3</option>
<option value="Level 4"  >4</option>
<option value="Level 5"  >5</option>
<option value="Level 6"  >6</option>
<option value="Level 7"  >7</option>

<option value="Level 8"  >8</option>
<option value="Level 9"  >9</option>
<option value="Level 10"  >10</option>
<option value="Level 11"  >11</option>
<option value="Level 12"  >12</option>
<option value="Level 13"  >13</option>
<option value="Level 14"  >14</option>
<option value="Level 15"  >15</option>
<option value="Level 16"  >16</option>

<option value="Level 17"  >17</option>
<option value="Level 18"  >18</option>
<option value="Level 19"  >19</option>
<option value="Level 20"  >20</option>
<option value="Level 21"  >21</option>
<option value="Level 22"  >22</option>
<option value="Level 23"  >23</option>
<option value="Level 24"  >24</option>
<option value="Level 25"  >25</option>

<option value="Level 26"  >26</option>
<option value="Level 27"  >27</option>
<option value="Level 28"  >28</option>
<option value="Level 29"  >29</option>
<option value="Level 30"  >30</option>
<option value="Level 31"  >31</option>
<option value="Level 32"  >32</option>
<option value="Level 33"  >33</option>
<option value="Level 34"  >34</option>

<option value="Level 35"  >35</option>
<option value="Level 36"  >36</option>
<option value="Level 37"  >37</option>
<option value="Level 38"  >38</option>
<option value="Level 39"  >39</option>
<option value="Level 40"  >40</option>
<option value="Level 41"  >41</option>
<option value="Level 42"  >42</option>
<option value="Level 43"  >43</option>

<option value="Level 44"  >44</option>
<option value="Level 45"  >45</option>
<option value="Level 46"  >46</option>
<option value="Level 47"  >47</option>
<option value="Level 48"  >48</option>
<option value="Level 49"  >49</option>
<option value="Level 50"  >50</option>
<option value="Level 51"  >51</option>
<option value="Level 52"  >52</option>

<option value="Level 53"  >53</option>
<option value="Level 54"  >54</option>
<option value="Level 55"  >55</option>
<option value="Level 56"  >56</option>
<option value="Level 57"  >57</option>
<option value="Level 58"  >58</option>
<option value="Level 59"  >59</option>
<option value="Level 60"  >60</option>
<option value="Level 61"  >61</option>

<option value="Level 62"  >62</option>
<option value="Level 63"  >63</option>
<option value="Level 64"  >64</option>
<option value="Level 65"  >65</option>
<option value="Level 66"  >66</option>
<option value="Level 67"  >67</option>
<option value="Level 68"  >68</option>
<option value="Level 69"  >69</option>
<option value="Level 70"  >70</option>

<option value="Level 71"  >71</option>
<option value="Level 72"  >72</option>
<option value="Level 73"  >73</option>
<option value="Level 74"  >74</option>
<option value="Level 75"  >75</option>
<option value="Level 76"  >76</option>
<option value="Level 77"  >77</option>
<option value="Level 78"  >78</option>
<option value="Level 79"  >79</option>

<option value="Level 80"  >80</option>
</select><br></td>
</tr>
<tr>
<td align="right">Primary Professions:</td>
<td>
<select name="primpro1>
<option value="" selected >
<option value="Alchemy"  >Alchemy</option>
<option value="Blacksmithing"  >Blacksmithing</option>
<option value="Enchanting"  >Enchanting</option>
<option value="Engineering"  >Engineering</option>
<option value="Herbalism"  >Herbalism</option>
<option value="Jewelcrafting"  >Jewelcrafting</option>
<option value="Leatherworking"  >Leatherworking</option>
<option value="Mining"  >Mining</option>
<option value="Tailoring"  >Tailoring</option>
<option value="Skinning"  >Skinning</option>
<option value="Inscription"  >Inscription</option>
</select>
Level:  <input type=text size=3 name="primpro1lv" cols="3" value=""><br>
</td>
</tr>
<tr>
<td></td>
<td>
<select name="primpro2">
<option value="" selected >
<option value="Alchemy"  >Alchemy</option>
<option value="Blacksmithing"  >Blacksmithing</option>
<option value="Enchanting"  >Enchanting</option>
<option value="Engineering"  >Engineering</option>
<option value="Herbalism"  >Herbalism</option>
<option value="Jewelcrafting"  >Jewelcrafting</option>
<option value="Leatherworking"  >Leatherworking</option>
<option value="Mining"  >Mining</option>
<option value="Tailoring"  >Tailoring</option>
<option value="Skinning"  >Skinning</option>
<option value="Inscription"  >Inscription</option>
</select>
Level:  <input type=text size=3 name="primpro2lv" cols="3" value=""><br><br>
</td>
</tr>
<tr>
<td align="right">
List all the spec(s) you <br>are willing to raid with:<br><i>(must have a primary spec)</i>
</td>
<td>
<textarea name="willspecs" rows=3 cols=25></textarea><br><br>
</td>
</tr>
<tr>
<td align="right">
Armory Link:<br>
<i>(Please make sure it<br>
has your typical<br>
raiding gear equipped)</i>
</td>
<td>
<textarea name="armorylink" rows=3 cols=25></textarea><br><br>
</td>
</tr>
<tr>
<td align="right">
Screenshot of your UI:<br>
<i>(You can use<br>
<a href="http://tinypic.com" target="_blank">http://tinypic.com</a>)</i>
</td>
<td>
<textarea name="ui" rows=3 cols=25></textarea><br><br>
</td>
</tr>
<tr>
<td align="right">
Alts:
</td>
<td>
<textarea name="alts" rows=3 cols=25></textarea>
</td>
</tr>
</table>

<table><tr><td><br><br><h2>Personal Information</h2></td><td></td></tr>
<tr>
<td align="right">What is your email address:
</td>
<td><textarea name="email" rows=1 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">What is your age:
</td>
<td><textarea name="age" rows=3 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">What time zone do you live in:
</td>
<td>
<select name="timezone">
<option value=""  ></option>
<option value="Pacific"  >Pacific</option>
<option value="Mountain"  >Mountain</option>
<option value="Central"  >Central</option>
<option value="Eastern"  >Eastern</option>
<option value="Alaskan"  >I live in Alaska</option>
<option value="Hawaiin"  >I live in Hawaii</option>
</select>
</td>
</tr>
<tr>
<td align="right">Do you have a working<br>microphone for use in Ventrilo?<br>
</td>
<td>
<select name="mic">
<option value=""  ></option>
<option value="does"  >Yes</option>
<option value="does not"  >No</option>
</select><i>(Highly suggested for<br>very important roles in raid)</i>
</td>
</tr>
<tr>
<td align="right">How many hours do you usually play a week:<br>
</td>
<td>
<select name="hours">
<option value=""  ></option>
<option value="0-10 Hours"  >0-10</option>
<option value="11-20 Hours"  >11-20</option>
<option value="21-30 Hours"  >21-30</option>
<option value="31-40 Hours"  >31-40</option>
<option value="41-50 Hours"  >41-50</option>
<option value="51-60 Hours"  >51-60</option>
<option value="61-70 Hours"  >61-70</option>
<option value="71-80 Hours"  >71-80</option>
<option value="81-90 Hours"  >81-90</option>
<option value="91-100 Hours"  >91-100</option>
<option value="101-110 Hours"  >101-110</option>
<option value="111-120 Hours"  >111-120</option>
<option value="121-130 Hours"  >121-130</option>
<option value="131-140 Hours"  >131-140</option>
<option value="141-150 Hours"  >141-150</option>
<option value="151-160 Hours"  >151-160</option>
<option value="161-168 Hours"  >161-168</option>
</select>
</td>
</tr>
<tr>
<td><br><br>What times are you available to raid?<br>
<b>Please be specific. Use Server Time (CST)</b><br><br>
</td>
</tr>
<tr>
<td align="right">
Monday:
</td>
<td><textarea name="raidmon" rows=2 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">
Tuesday:
</td>
<td><textarea name="raidtues" rows=2 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">
Wednesday:
</td>
<td><textarea name="raidwed" rows=2 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">
Thursday:
</td>
<td><textarea name="raidthurs" rows=2 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">
Friday:
</td>
<td><textarea name="raidfri" rows=2 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">
Saturday:
</td>
<td><textarea name="raidsat" rows=2 cols=25></textarea>
</td>
</tr>
<tr>
<td align="right">
Sunday:
</td>
<td><textarea name="raidsun" rows=2 cols=25></textarea>
</td>
</tr>
</table>
<table>
<tr>
<td>How did you hear about Nothing Personal:<br>
<textarea name="heard" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>Why do you want to join Nothing Personal?<br>
<textarea name="whyjoin" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>Is there anyone in the guild who would recommend you?<br>
<textarea name="friendrecom" rows=3 cols=50></textarea><br><br>
<td>
</tr>
</tr>
<td>What are the previous guilds you've been in?<br>
Why did you leave? <i>List as many as you can.</i><br>
<textarea name="prevguilds" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>What raid experience do you have?<br>
<textarea name="raidexp" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<td> </td>
</tr>
<tr>
<td>What sites, if any, do you visit regularly<br>
to help improve your play and gear?<br>
<textarea name="sitevisits" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>Do you have the required programs and addons? Please list them.<br>
<textarea name="reqprog" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>Do you have a reliable internet connection:<br>
(Please include what type of connection you have)<br>
<textarea name="netcon" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>What consumables will you bring to a raid? Are you willing to put forth<br>
the time to farm for your own consumables for raids?<br>
<textarea name="raidconsume" rows=3 cols=50></textarea><br><br>
</td>
</tr>
<tr>
<td>
    Please enter your comments below.  Click "Submit" when done.<br>
    <textarea name="comments" rows=10 cols=50></textarea>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

<p><input type="submit" name="submit" value="Submit" /></p>

</form>
</div>
</body>
</html>

 

 

This is the complete contents of process.php

<html><body>
<?php


$EmailFrom = "***";
$EmailTo = "***";
$Subject = "NP Application";


$charname = Trim(stripslashes($_POST['charname']));
$race = Trim(stripslashes($_POST_VARS['race']));
$class = Trim(stripslashes($_POST['class']));
$level = Trim(stripslashes($_POST['level']));
$primpro1 = Trim(stripslashes($_POST['primpro1']));
$primpro1lv = Trim(stripslashes($_POST['primpro1lv']));
$primpro2 = Trim(stripslashes($_POST['primpro2']));
$primpro2lv = Trim(stripslashes($_POST['primpro2lv']));
$willspecs = Trim(stripslashes($_POST['willspecs']));
$armorylink = Trim(stripslashes($_POST['armorylink']));
$ui = Trim(stripslashes($_POST['ui']));
$alts = Trim(stripslashes($_POST['alts']));
$email = Trim(stripslashes($_POST['email']));
$age = Trim(stripslashes($_POST['age']));
$timezone = Trim(stripslashes($_POST['timezone']));
$mic = Trim(Trim(stripslashes($_POST['mic']));
$hours = Trim(Trim(stripslashes($_POST['hours']));
$raidmon = Trim(stripslashes($_POST['raidmon']));
$raidtues = Trim(stripslashes($_POST['raidtues']));
$raidwed = Trim(stripslashes($_POST['raidwed']));
$raidthurs = Trim(stripslashes($_POST['raidthurs']));
$raidfri = Trim(stripslashes($_POST['raidfri']));
$raidsat = Trim(stripslashes($_POST['raidsat']));
$raidsun = Trim(stripslashes($_POST['raidsun']));
$heard = Trim(stripslashes($_POST['heard']));
$whyjoin = Trim(stripslashes($_POST['whyjoin']));
$friendrecom = Trim(stripslashes($_POST['friendrecom']));
$prevguilds = Trim(stripslashes($_POST['prevguilds']));
$raidexp = Trim(stripslashes($_POST['raidexp']));
$sitevisits = Trim(stripslashes($_POST['sitevisits']));
$reqprog = Trim(stripslashes($_POST['reqprog']));
$netcon = Trim(stripslashes($_POST['netcon']));
$raidconsume = Trim(stripslashes($_POST['raidconsume']));
$comments = Trim(stripslashes($_POST['comments']));


$validationOK=true;
if (Trim($First)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}


$Body = "";
$Body .= "Character Name: ";
$Body .= $charname;
$Body .= "\n";
$Body .= "Character Race: ";
$Body .= $race;
$Body .= "\n";
$Body .= "Character Class: ";
$Body .= $class;
$Body .= "\n";
$Body .= "Character Level: ";
$Body .= $level;
$Body .= "\n";
$Body .= "Primary Profession 1: ";
$Body .= $primpro1;
$Body .= "\n";
$Body .= "Primary Profession 1 Level: ";
$Body .= $primpro1lv;
$Body .= "\n";
$Body .= "Primary Profession 2: ";
$Body .= $primpro1;
$Body .= "\n";
$Body .= "Primary Profession 2 Level: ";
$Body .= $primpro1lv;
$Body .= "\n";
$Body .= "List all the specs you are willing to raid with ";
$Body .= $willspecs;
$Body .= "\n";
$Body .= "Armory Link: ";
$Body .= $armorylink;
$Body .= "\n";
$Body .= "Screenshot of your UI: ";
$Body .= $ui;
$Body .= "\n";
$Body .= "Alts: ";
$Body .= $alts;
$Body .= "\n";
$Body .= "What is your email address: ";
$Body .= $email;
$Body .= "\n";
$Body .= "What is your age: ";
$Body .= $age;
$Body .= "\n";
$Body .= "What time zone do you live in: ";
$Body .= $timezone;
$Body .= "\n";
$Body .= "Do you have a working microphone for use in Ventrilo: ";
$Body .= $mic;
$Body .= "\n";
$Body .= "How many hours do you usually play a week: ";
$Body .= $hours;
$Body .= "\n";
$Body .= "What times are you available to raid? Monday: ";
$Body .= $raidmon;
$Body .= "\n";
$Body .= "What times are you available to raid? Tuesday: ";
$Body .= $raidtues;
$Body .= "\n";
$Body .= "What times are you available to raid? Wednesday: ";
$Body .= $raidwed;
$Body .= "\n";
$Body .= "What times are you available to raid? Thursday: ";
$Body .= $raidthurs;
$Body .= "\n";
$Body .= "What times are you available to raid? Friday: ";
$Body .= $raidfri;
$Body .= "\n";
$Body .= "What times are you available to raid? Saturday: ";
$Body .= $raidsat;
$Body .= "\n";
$Body .= "What times are you available to raid? Sunday: ";
$Body .= $raidsun;
$Body .= "\n";
$Body .= "How did you hear about Nothing Personal: ";
$Body .= $heard;
$Body .= "\n";
$Body .= "Why do you want to join Nothing Personal: ";
$Body .= $whyjoin;
$Body .= "\n";
$Body .= "Is there anyone in the guild who would recommend you: ";
$Body .= $friendrecom;
$Body .= "\n";
$Body .= "What are the previous guilds you've been in? Why did you leave: ";
$Body .= $prevguilds;
$Body .= "\n";
$Body .= "What raid experience do you have?: ";
$Body .= $raidexp;
$Body .= "\n";
$Body .= "What sites, if any, do you visit regularly to help improve your play and gear?: ";
$Body .= $sitevisits;
$Body .= "\n";
$Body .= "Do you have the required programs and addons? Please list them: ";
$Body .= $reqprog;
$Body .= "\n";
$Body .= "Do you have a reliable internet connection:: ";
$Body .= $netcon;
$Body .= "\n";
$Body .= "What consumables will you bring to a raid? Are you willing to put forth the time to farm for your own consumables for raids: ";
$Body .= $raidconsume;
$Body .= "\n";
$Body .= "Please enter your comments below: ";
$Body .= $comments;
$Body .= "\n";


$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");


if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
</body></html>

 

Link to comment
Share on other sites

If the server pukes a white (blank) page at you, it means the server killed the process. Meaning your php code "crashed."

 

Unless you have a virtual or dedicated server you won't be able to check out the log files of the server. You'll need to start from scratch one and re do it all over again. I had this happen to me before too.  :-X

Link to comment
Share on other sites

Hi leoashcraft,

 

The best method to troubleshoot would be to get access to the Apache error log for the website. Most hosts will grant you access to your site logs depending on how they have their clients setup. Within the error_log there should be some PHP notices/errors that can give you more information as to why the page isn't functioning properly & go from there.

 

Link to comment
Share on other sites

    One thing I wanted to add for you is that you can try to break the script down more and have it echo out statements at certain points and then exit to see how far down it is getting before the error. This will let you hone in on the error. Also is there any source code out put at all from the server?

    You should also look create a phpinfo page and make sure that your host has mail() configured.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.