Form Building Help?

  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

I have recently started constructing a basic html form. The info is just sent straight to my email, which is exactly what I want. But when it is sent, its just one line of text. Is there anyway that you can tidy up the output information to your email? Is there anyway I can receive it in a table or form type layout?

Here is the output I get:
firstname=Justin&lastname=Higgins&socialsecuritynumber=55555555555&Phonenumber=5015555555&sex=male&Address=2500+hwy.+65&City=Clinton&State=ar&Zip+code=72034&Position=tech&Hours=Full+Time&Hours=Part+Time&textarea=Joomla+CMS+and+Dreamweaver+Design%2C+php%2C+apache

Below is the form:

Code: [ Select ]
<style type="text/css">
<!--
body {
    background-color: #999999;
}
.style2 {font-size: 24px}
.style3 {font-size: 18px}
-->
</style><form name="input" action="mailto:my@address.com"
method="post">
<span class="style2">Ozark Health</span><br>
<br>
<span class="style3">Application for Employment</span><br>
<br>
<strong>Instructions:</strong>Complete all necessary information. You may be asked to provide additional information on another
<br />
form. This application will be kept on file. It is to your advantage to Periodically check to keep it current and active. Be <br />
sure to sign and date the application.<br /><br>
First Name:
<input type="text" name="firstname">
<br><br>
Last name:
<input type="text" name="lastname">
<br><br>
Social Security Number:
<input type="text" name="socialsecuritynumber">
<br><br>
Phone:
<input type="text" name="Phonenumber">
<br><br>
<input type="radio" name="sex" value="male"> Male

<input type="radio" name="sex" value="female"> Female
<br><br>
Address:
<input name="Address" type="text" size="56">
<br><br>
City:
<input type="text" name="City">

State:
<input name="State" type="text" size="6">

Zip Code:
<input name="Zip code" type="text" size="12">
<br><br>
Position Applied For:
<input name="Position" type="text" size="30">
<br><br>
Select the following that you would accept:
<br><br>
Full Time
<input type="checkbox" name="Hours" value="Full Time">
Part Time
<input type="checkbox" name="Hours" value="Part Time">
PRN
<input type="checkbox" name="Hours" value="PRN">
<br><br>
<p> Special Training or skills: (languages, machine operation, etc.) </p>
<textarea name="textarea" cols="50" rows="10"> Skills... </textarea>
<br>
<br>

<input type="submit" value="Submit">
</form>
  1. <style type="text/css">
  2. <!--
  3. body {
  4.     background-color: #999999;
  5. }
  6. .style2 {font-size: 24px}
  7. .style3 {font-size: 18px}
  8. -->
  9. </style><form name="input" action="mailto:my@address.com"
  10. method="post">
  11. <span class="style2">Ozark Health</span><br>
  12. <br>
  13. <span class="style3">Application for Employment</span><br>
  14. <br>
  15. <strong>Instructions:</strong>Complete all necessary information. You may be asked to provide additional information on another
  16. <br />
  17. form. This application will be kept on file. It is to your advantage to Periodically check to keep it current and active. Be <br />
  18. sure to sign and date the application.<br /><br>
  19. First Name:
  20. <input type="text" name="firstname">
  21. <br><br>
  22. Last name:
  23. <input type="text" name="lastname">
  24. <br><br>
  25. Social Security Number:
  26. <input type="text" name="socialsecuritynumber">
  27. <br><br>
  28. Phone:
  29. <input type="text" name="Phonenumber">
  30. <br><br>
  31. <input type="radio" name="sex" value="male"> Male
  32. <input type="radio" name="sex" value="female"> Female
  33. <br><br>
  34. Address:
  35. <input name="Address" type="text" size="56">
  36. <br><br>
  37. City:
  38. <input type="text" name="City">
  39. State:
  40. <input name="State" type="text" size="6">
  41. Zip Code:
  42. <input name="Zip code" type="text" size="12">
  43. <br><br>
  44. Position Applied For:
  45. <input name="Position" type="text" size="30">
  46. <br><br>
  47. Select the following that you would accept:
  48. <br><br>
  49. Full Time
  50. <input type="checkbox" name="Hours" value="Full Time">
  51. Part Time
  52. <input type="checkbox" name="Hours" value="Part Time">
  53. PRN
  54. <input type="checkbox" name="Hours" value="PRN">
  55. <br><br>
  56. <p> Special Training or skills: (languages, machine operation, etc.) </p>
  57. <textarea name="textarea" cols="50" rows="10"> Skills... </textarea>
  58. <br>
  59. <br>
  60. <input type="submit" value="Submit">
  61. </form>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

You're going to have to format this before mailing it. Do you have a scripting language available to you...on your server?
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

Would php 5 work?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

php works just fine. Although this link addresses using PHP to mail from Flash, it's essentially what you need to use
flash-forum/send-mail-via-php-using-flash-t83259.html You can use your same form, but instead of a "mailto" your action would be a link to your php mailer script.
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

I am going by your first reply on that topic. Is the first code what I need to put into my html file and does the vmail.php need to be located in a specific location on the server? I am very new to this type of thing. Sorry if i am being a bother
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

I am using the Wamp Server as a testing enviroment for this, I have run into some problems though.

Here is my entire form and it is save as a html file, is this the correct file type?

Code: [ Select ]
<style type="text/css">
<!--
body {
    background-color: #CCCCCC;
}
.style2 {font-size: 24px}
.style3 {font-size: 18px}
-->
</style>
<form name="input" action="on (release) {
   if (name eq "" or phone eq "" or email eq "" or message eq "") {
      error.gotoAndPlay("error");
   } else {
      loadVariablesNum("vmail.php", 0, "POST");
      error.gotoAndPlay("sent");
      name = "";
      phone = "";
      email = "";
      message = "";
   }
}"
method="Post">
 
 
 
<p><span class="style2">Ozark Health</span><br>
    <br>
    <span class="style3">Application for Employment</span><br>
    <br>
    <strong>Instructions:</strong>Complete all necessary information. You may be asked to provide additional information on another
  <br />
  form.  This application will be kept on file.  It is to your advantage to Periodically check to keep it current and active. Be <br />
  sure to sign and date the application.<br />
  <br>
  First Name:
  <input type="text" name="firstname">
  <br>
  <br>
  Last name:
  <input type="text" name="lastname">
  <br>
  <br>
  Social Security Number:
  <input type="text" name="socialsecuritynumber">
  <br>
  <br>
  Phone:
  <input type="text" name="Phonenumber">
  <br>
  <br>
  <input type="radio" name="sex" value="male">
  Male
 
  <input type="radio" name="sex" value="female">
  Female
  <br>
  <br>
  Address:
  <input name="Address" type="text" size="56">
  <br>
  <br>
  City:
  <input type="text" name="City">
 
  State:
  <input name="State" type="text" size="6">
 
  Zip Code:
  <input name="Zip code" type="text" size="12">
  <br>
  <br>
  Position Applied For:
  <input name="Position" type="text" size="30">
  <br>
  <br>
  Select the following that you would accept:
  <br>
  <br>
  Full Time
  <input type="checkbox" name="Hours" value="Full Time">
  Part Time
  <input type="checkbox" name="Hours" value="Part Time">
  PRN
  <input type="checkbox" name="Hours" value="PRN">
  <br>
  <br>
  Date You will be available to work?
  <br />
  <br />
  <select name="Month">
    <option value="January">Jan</option>
    <option value="Feb">Feb</option>
    <option value="March">March</option>
    <option value="April">April</option>
    <option value="May">May</option>
    <option value="June">June</option>
    <option value="July">July</option>
    <option value="Aug">Aug</option>
    <option value="Sept">Sept</option>
    <option value="Oct">Oct</option>
    <option value="Nov">Nov</option>
    <option value="Dec">Dec</option>
  </select>
  -
  <select name="Day">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
  </select>
  -
  <select name="Year">
    <option value="2008">2008</option>
    <option value="2009">2009</option>
    <option value="2010">2010</option>
  </select>
  </p>
<p><br />
Have you ever been employed here in the past?
<input type="radio" name="everbeenemployedhere" value="Yes"> Yes
<input type="radio" name="everbeenemployedhere" value="No"> No
Date:
<input type="text" name="Date">
 
 
</p>
<p> Special Training or skills: (languages, machine operation, etc.) </p>
<textarea name="textarea" cols="50" rows="10"> Skills... </textarea>
<br>
<br>
 
<br />
<br />
<input type="submit" value="Submit">
</form>
  1. <style type="text/css">
  2. <!--
  3. body {
  4.     background-color: #CCCCCC;
  5. }
  6. .style2 {font-size: 24px}
  7. .style3 {font-size: 18px}
  8. -->
  9. </style>
  10. <form name="input" action="on (release) {
  11.    if (name eq "" or phone eq "" or email eq "" or message eq "") {
  12.       error.gotoAndPlay("error");
  13.    } else {
  14.       loadVariablesNum("vmail.php", 0, "POST");
  15.       error.gotoAndPlay("sent");
  16.       name = "";
  17.       phone = "";
  18.       email = "";
  19.       message = "";
  20.    }
  21. }"
  22. method="Post">
  23.  
  24.  
  25.  
  26. <p><span class="style2">Ozark Health</span><br>
  27.     <br>
  28.     <span class="style3">Application for Employment</span><br>
  29.     <br>
  30.     <strong>Instructions:</strong>Complete all necessary information. You may be asked to provide additional information on another
  31.   <br />
  32.   form.  This application will be kept on file.  It is to your advantage to Periodically check to keep it current and active. Be <br />
  33.   sure to sign and date the application.<br />
  34.   <br>
  35.   First Name:
  36.   <input type="text" name="firstname">
  37.   <br>
  38.   <br>
  39.   Last name:
  40.   <input type="text" name="lastname">
  41.   <br>
  42.   <br>
  43.   Social Security Number:
  44.   <input type="text" name="socialsecuritynumber">
  45.   <br>
  46.   <br>
  47.   Phone:
  48.   <input type="text" name="Phonenumber">
  49.   <br>
  50.   <br>
  51.   <input type="radio" name="sex" value="male">
  52.   Male
  53.  
  54.   <input type="radio" name="sex" value="female">
  55.   Female
  56.   <br>
  57.   <br>
  58.   Address:
  59.   <input name="Address" type="text" size="56">
  60.   <br>
  61.   <br>
  62.   City:
  63.   <input type="text" name="City">
  64.  
  65.   State:
  66.   <input name="State" type="text" size="6">
  67.  
  68.   Zip Code:
  69.   <input name="Zip code" type="text" size="12">
  70.   <br>
  71.   <br>
  72.   Position Applied For:
  73.   <input name="Position" type="text" size="30">
  74.   <br>
  75.   <br>
  76.   Select the following that you would accept:
  77.   <br>
  78.   <br>
  79.   Full Time
  80.   <input type="checkbox" name="Hours" value="Full Time">
  81.   Part Time
  82.   <input type="checkbox" name="Hours" value="Part Time">
  83.   PRN
  84.   <input type="checkbox" name="Hours" value="PRN">
  85.   <br>
  86.   <br>
  87.   Date You will be available to work?
  88.   <br />
  89.   <br />
  90.   <select name="Month">
  91.     <option value="January">Jan</option>
  92.     <option value="Feb">Feb</option>
  93.     <option value="March">March</option>
  94.     <option value="April">April</option>
  95.     <option value="May">May</option>
  96.     <option value="June">June</option>
  97.     <option value="July">July</option>
  98.     <option value="Aug">Aug</option>
  99.     <option value="Sept">Sept</option>
  100.     <option value="Oct">Oct</option>
  101.     <option value="Nov">Nov</option>
  102.     <option value="Dec">Dec</option>
  103.   </select>
  104.   -
  105.   <select name="Day">
  106.     <option value="1">1</option>
  107.     <option value="2">2</option>
  108.     <option value="3">3</option>
  109.     <option value="4">4</option>
  110.     <option value="5">5</option>
  111.     <option value="6">6</option>
  112.     <option value="7">7</option>
  113.     <option value="8">8</option>
  114.     <option value="9">9</option>
  115.     <option value="10">10</option>
  116.     <option value="11">11</option>
  117.     <option value="12">12</option>
  118.     <option value="13">13</option>
  119.     <option value="14">14</option>
  120.     <option value="15">15</option>
  121.     <option value="16">16</option>
  122.     <option value="17">17</option>
  123.     <option value="18">18</option>
  124.     <option value="19">19</option>
  125.     <option value="20">20</option>
  126.     <option value="21">21</option>
  127.     <option value="22">22</option>
  128.     <option value="23">23</option>
  129.     <option value="24">24</option>
  130.     <option value="25">25</option>
  131.     <option value="26">26</option>
  132.     <option value="27">27</option>
  133.     <option value="28">28</option>
  134.     <option value="29">29</option>
  135.     <option value="30">30</option>
  136.     <option value="31">31</option>
  137.   </select>
  138.   -
  139.   <select name="Year">
  140.     <option value="2008">2008</option>
  141.     <option value="2009">2009</option>
  142.     <option value="2010">2010</option>
  143.   </select>
  144.   </p>
  145. <p><br />
  146. Have you ever been employed here in the past?
  147. <input type="radio" name="everbeenemployedhere" value="Yes"> Yes
  148. <input type="radio" name="everbeenemployedhere" value="No"> No
  149. Date:
  150. <input type="text" name="Date">
  151.  
  152.  
  153. </p>
  154. <p> Special Training or skills: (languages, machine operation, etc.) </p>
  155. <textarea name="textarea" cols="50" rows="10"> Skills... </textarea>
  156. <br>
  157. <br>
  158.  
  159. <br />
  160. <br />
  161. <input type="submit" value="Submit">
  162. </form>



Here is the exact code for my vmail.php file:

PHP Code: [ Select ]
<?
if (isset($HTTP_POST_VARS)) {
 
$name = $HTTP_POST_VARS["name"];
$phone = $HTTP_POST_VARS["phone"];
$email = $HTTP_POST_VARS["email"];
$message = $HTTP_POST_VARS["message"];
}
 
$to = "justin.huggins@myozarkhealth.com";
$subject = "SITE Admin";
$msg .= "Senders Name: " ."$name\n\n";
$msg .= "Phone: " ."$phone\n\n";
$msg .= "Email: " ."$email\n\n";
$msg .= "Message: " ."$message\n\n";
$msg .= "This message was sent to you from My Site Contact Form.\n\n";
$msg .= "Do not reply to this email directly.";
 
mail($to, $subject, $msg, "From: My Site Contact Form\nReply-To: $email\n");
 
?>
  1. <?
  2. if (isset($HTTP_POST_VARS)) {
  3.  
  4. $name = $HTTP_POST_VARS["name"];
  5. $phone = $HTTP_POST_VARS["phone"];
  6. $email = $HTTP_POST_VARS["email"];
  7. $message = $HTTP_POST_VARS["message"];
  8. }
  9.  
  10. $to = "justin.huggins@myozarkhealth.com";
  11. $subject = "SITE Admin";
  12. $msg .= "Senders Name: " ."$name\n\n";
  13. $msg .= "Phone: " ."$phone\n\n";
  14. $msg .= "Email: " ."$email\n\n";
  15. $msg .= "Message: " ."$message\n\n";
  16. $msg .= "This message was sent to you from My Site Contact Form.\n\n";
  17. $msg .= "Do not reply to this email directly.";
  18.  
  19. mail($to, $subject, $msg, "From: My Site Contact Form\nReply-To: $email\n");
  20.  
  21. ?>
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

What kind of errors do you get? On my wamp I'm supposed to use <?php rather than [b]<?[/php] as it doesn't work (Just a configuration thing but it doesn't bother me).

instead of $HTTP_POST_VARS try $_POST['name'] and so on... see if that helps. $_REQUEST['name'] works as well (It checks if the variable is a $_POST or $_GET but it's unsecure).
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\DreamweaverCS3\vmail\send_contact.php on line 15
ERROR

Here is my php mailer script I made some changes:

<?php
// Contact subject
$subject ="$subject";
// Details
$message="$detail";

// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='someone@somewhere.com';

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6243
  • Loc: Seattle, WA

Post 3+ Months Ago

Do you have an SMTP server setup and configured on your local machine?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

You would need to install a local SMTP SERVER or get a testing host that supports the php function mail.

If you are going to make this live, I suggest you use a SMTP version of mail... there's no preset functions, but there are a lot of functions out there which do that... PEAR for instance as most hosts don't support the mail function because it is overused as spam.
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

I have a smtp server setup and configured on a different machine. Does the smpt server have to be running php on it as well?
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6243
  • Loc: Seattle, WA

Post 3+ Months Ago

No, but you need to configure PHP to use the SNMP server that you setup. I believe that PHP looks for it on localhost by default, so if it's on a different machine you'll want to edit your php.ini file to point to it.
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

I changed the hostname to that of my smtp server, its not working correctly still. Do I need to specify the port as well? And does it matter whether I use the IP Address or the hostname for smtp server?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

You need to specify a port, host, (user?,) and a password (That's if I remember how to do it from the time when I was playing around with SMTP :lol: )
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

I have specified all of these, but I am still having issues getting it to work. Is there any freeware or cheap mailserver software that I can just set up on the server locally. I will only need 1 or 2 email accounts, but I do need it to be secure.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I provided you with one here.
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

Sorry that was a very stupid comment, I have php 5 downloaded on my webserver. Right now my email host is through myozarkhealth.com(which is on a separate machine) and my website is ozarkhealthinc.com and I do have php running on this machine along with apache and mySQL. So i guess what I am asking is how to go about setting up ozarkhealthinc.com email accounts? If you havent noticed I am very new to this kind of work, someone else has always taken care of this side of things, I usually just designed until recently.
  • justin7542
  • Novice
  • Novice
  • User avatar
  • Posts: 29

Post 3+ Months Ago

Haha nevermind I just made myself look stupid again. How about we just forget that last post.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

:lol: ok... I do that often enough here

Post Information

  • Total Posts in this topic: 19 posts
  • Users browsing this forum: michellejerson and 51 guests
  • 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 post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.