473,788 Members | 2,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Form Help!

22 New Member
I have this form setup to allow customers to fill in a little info and send an email to particular departments that they have their questions in. For some reason I cannot get it to work and in further playing around with it I get an HTTP 500 IS Error and it won't even load the page. Please help! Oh and I took the @ addres off the emails for this post. I know they're not there.

Expand|Select|Wrap|Line Numbers
  1.   $Dept   = $_REQUEST['Department'];
  2.   $First  = $_REQUEST['firstname'];
  3.   $Last   = $_REQUEST['lastname'];
  4.   $Com    = $_REQUEST['company'];
  5.   $Acc    = $_REQUEST['account'];
  6.   $Add    = $_REQUEST['adderss'];
  7.   $City   = $_REQUEST['city'];
  8.   $State  = $_REQUEST['state'];
  9.   $Zip    = $_REQUEST['zip'];
  10.   $Phone  = $_REQUEST['phone'];
  11.   $Email  = $_REQUEST['email'];
  12.   $Help   = $_REQUEST['help'];
  13.   $Sub    = $_REQUEST['subject'];
  14.   $Mess   = $_REQUEST['message'];
  15.  
  16.   $message = $First." ".$Last."\n";
  17.   $message .= $Com."\n";
  18.   $message .= $Acc."\n\n";
  19.   $message .= $Add."\n";
  20.   $message .= $City." ".",".$State." ".",".$Zip."\n";
  21.   $message .= $Phone."\n";
  22.   $message .= $Email."\n";
  23.   $message .= $Help."\n\n";
  24.   $message .= $Mess;
  25.  
  26.   switch ($Dept) 
  27.   {
  28.     case "Repair Parts":
  29.       $email_to = "rlacey", "hrichwine";
  30.       break;
  31.     case "Rebuilt Exchange Parts":
  32.       $email_to="rlacey", "hrichwine";
  33.       break;
  34.      case "Conversions & Conversion Kits":
  35.       $email_to="rlacey", "hrichwine";
  36.       break;
  37.     case "Test Equipment & Specialty Items":
  38.       $email_to="rlacey", "hrichwine";
  39.       break;
  40.     case "Test Equipment & Specialty Items":
  41.       $email_to="rlacey", "hrichwine";
  42.       break;
  43.     case "Customer Service":
  44.       $email_to="rlacey", "hrichwine";
  45.       break;
  46.     case "Account Receivable":
  47.       $email_to="kfatherree", "tfraker";
  48.       break;
  49.     case "Accounts Payable":
  50.       $email_to="jlehman", "tfraker";
  51.       break;
  52.     case "Service Schools":
  53.       $email_to="hrichwine";
  54.       break;
  55.     case "Rebuilt Exchange Parts":
  56.       $email_to="sfrank";
  57.       break;
  58.     case "Operations":
  59.       $email_to="ecowan", "eburkhart";
  60.       break;
  61.     case "President":
  62.       $email_to="bbowman", "hrichwine";
  63.       break;
  64.     case "Service Center":
  65.       $email_to="eburkhart", "ecowan";
  66.       break;
  67.     case "Sales / Marketing":
  68.       $email_to="pjones", "tgasull";
  69.       break;
  70.     case "Tech Support":
  71.       $email_to="dfreet", "ssteinour";
  72.       break;
  73.     default:
  74.       $email_to = "ijimenez";  // fail-safe value    
  75.   }
  76.   mail( $email_to, "Feedback Form Results", $message, "From: $email" );
Nov 28 '08 #1
17 1945
Dormilich
8,658 Recognized Expert Moderator Expert
Hi Nyris,

$email_to = "name", "name2"; will probably throw an error. if you meant to concatenate the two strings, use the dot operator (see PHP: Strings - Manual)

and one more thing:

For the benefit of our experts and yourself, it is a posting guidelines that all users use [code] tags when posting code. This makes the code easier to read and, in turn, helps our experts answer your questions.

An easy way to do this is to highlight the code in the textarea and then hit the '#' button at the top of the textarea.

Please read the Posting Guidlines so you're more familiar with how things work.

regards
Nov 28 '08 #2
Markus
6,050 Recognized Expert Expert
@Dormilich
That sounds familiar :P

Yes, Nyris, please do use [code] tags.

Moderator.
Nov 28 '08 #3
Nyris
22 New Member
Sorry, I'll remember to do it next time. Thanks for the help on the dot operator. The page loads now and there isn't an error until the submit button is hit. Then it gives the 500 Error - IS Error.

Any ideas on why? Thanks in advice for the help!
Nov 28 '08 #4
Dormilich
8,658 Recognized Expert Moderator Expert
maybe we can spot an error if we can have a look at the html output file (maybe some form action error..)

@markus: I couldn't put it in better words, so - yes
Nov 28 '08 #5
Markus
6,050 Recognized Expert Expert
@Dormilich
No problamo, homie.
Nov 28 '08 #6
Nyris
22 New Member
Here's what I have for the actual form. Thanks again in advance!

Expand|Select|Wrap|Line Numbers
  1. <form method="post">
  2. <table width="100%" border="1">
  3.   <tr>
  4.     <td width="69%">FSIP Online Contact Form:
  5.     <table width="467" border="1">
  6.   <tr>
  7.     <td colspan="2">Please Select Department to Send Message To:*<br />
  8.     <select name="Department">
  9. <option selected="selected" value="Repair Parts">Repair Parts</option>
  10. <option value="Rebuilt Exchange Parts">Rebuilt Exchange Parts</option>
  11. <option value="Conversions & Conversion Kits">Conversions & Conversion Kits</option>
  12. <option value="Test Equipment & Specialty Items">Test Equipment & Specialty Items</option>
  13. <option value="Customer Service">Customer Service</option>
  14. <option value="Accounts Receivable">Accounts Receivable</option>
  15. <option value="Accounts Payable">Accounts Payable</option>
  16. <option value="Service Schools">Service Schools</option>
  17. <option value="Engineering">Engineering</option>
  18. <option value="Operations">Operations</option>
  19. <option value="President">President</option>
  20. <option value="Service Center">Service Center</option>
  21. <option value="Sales / Marketing">Sales / Marketing</option>
  22. <option value="Tech Support">Tech Support</option>
  23. </select>    </td>
  24.   </tr>
  25.   <tr>
  26.     <td width="230">First name:*<br />
  27. <input type="text" name="firstname" size=""></td>
  28.     <td width="221">Last name:*<br />
  29. <input type="text" name="lastname"></td>
  30.   </tr>
  31.   <tr>
  32.     <td>Company Name:* <br />
  33. <input type="text" name="company"></td>
  34.     <td>Account # (If Applicable):<br />
  35. <input type="text" name="account"></td>
  36.   </tr>
  37.   <tr>
  38.     <td colspan="2">Address*:<br />
  39. <input type="text" name="address" size="63"></td>
  40.   </tr>
  41.   <tr>
  42.     <td>City*:<br />
  43. <input type="text" name="city"></td>
  44.     <td>State:<br />
  45. <select name="state">
  46.                             <option selected="selected" value="AL">Alabama</option>
  47.                             <option value="AK">Alaska</option>
  48.                             <option value="AZ">Arizona</option>
  49.                             <option value="AR">Arkansas</option>
  50.  
  51.                             <option value="CA">California</option>
  52.                             <option value="CO">Colorado</option>
  53.                             <option value="CT">Connecticut</option>
  54.                             <option value="DE">Delaware</option>
  55.                             <option value="DC">District of Columbia</option>
  56.                             <option value="FL">Florida</option>
  57.  
  58.                             <option value="GA">Georgia</option>
  59.                             <option value="HI">Hawaii</option>
  60.                             <option value="ID">Idaho</option>
  61.                             <option value="IL">Illinois</option>
  62.                             <option value="IN">Indiana</option>
  63.                             <option value="IA">Iowa</option>
  64.  
  65.                             <option value="KS">Kansas</option>
  66.                             <option value="KY">Kentucky</option>
  67.                             <option value="LA">Louisiana</option>
  68.                             <option value="ME">Maine</option>
  69.                             <option value="MD">Maryland</option>
  70.                             <option value="MA">Massachusetts</option>
  71.  
  72.                             <option value="MI">Michigan</option>
  73.                             <option value="MN">Minnesota</option>
  74.                             <option value="MS">Mississippi</option>
  75.                             <option value="MO">Missouri</option>
  76.                             <option value="MT">Montana</option>
  77.                             <option value="NE">Nebraska</option>
  78.  
  79.                             <option value="NV">Nevada</option>
  80.                             <option value="NH">New Hampshire</option>
  81.                             <option value="NJ">New Jersey</option>
  82.                             <option value="NM">New Mexico</option>
  83.                             <option value="NY">New York</option>
  84.                             <option value="NC">North Carolina</option>
  85.  
  86.                             <option value="ND">North Dakota</option>
  87.                             <option value="OH">Ohio</option>
  88.                             <option value="OK">Oklahoma</option>
  89.                             <option value="OR">Oregon</option>
  90.                             <option value="PA">Pennsylvania</option>
  91.                             <option value="RI">Rhode Island</option>
  92.  
  93.                             <option value="SC">South Carolina</option>
  94.                             <option value="SD">South Dakota</option>
  95.                             <option value="TN">Tennessee</option>
  96.                             <option value="TX">Texas</option>
  97.                             <option value="UT">Utah</option>
  98.                             <option value="VT">Vermont</option>
  99.  
  100.                             <option value="VA">Virginia</option>
  101.                             <option value="WA">Washington</option>
  102.                             <option value="WV">West Virginia</option>
  103.                             <option value="WI">Wisconsin</option>
  104.                             <option value="WY">Wyoming</option>
  105. </select></td>
  106.   </tr>
  107.   <tr>
  108.     <td>Zip Code*:<br />
  109. <input type="text" name="zip"></td>
  110.     <td>Phone*:<br />
  111. <input type="text" name="phone"></td>
  112.   </tr>
  113.   <tr>
  114.     <td>E-mail Address*:<br />
  115. <input type="text" name="email"></td>
  116.     <td>How helpful was our website?<br />
  117. <select name="help">
  118. <option selected="selected" value="NC">No Comment</option>
  119. <option value="EH">Extremely Helpful</option>
  120. <option value="AA">Above Average</option>
  121. <option value="A">Average</option>
  122. <option value"BA">Below Average</option>
  123. </select></td>
  124.   </tr>
  125.   <tr>
  126.     <td colspan="2">Message Subject:<br />
  127. <input type="text" name="subject" size="63"></td>
  128.   </tr>
  129.   <tr>
  130.     <td colspan="2">Message/Comment*:<br />
  131. <textarea name="message" cols="63" rows="5" colspan="2"></textarea></td>
  132.   </tr>
  133.   <tr>
  134.     <td colspan="2"><div align="center"><input type="submit"/
Dec 1 '08 #7
Dormilich
8,658 Recognized Expert Moderator Expert
you have not specified the file, that should process your form.
Expand|Select|Wrap|Line Numbers
  1. <form action="form_processing_file" method="post">
note: the action-attribute is mandatory, therefore the error.

regards
Dec 1 '08 #8
Nyris
22 New Member
I'm sorry.. New to PHP.. This file is something that I created or just simply put what you have there?
Dec 1 '08 #9
Dormilich
8,658 Recognized Expert Moderator Expert
@Nyris
......???

your HTTP 500 error is actually not a PHP error but a HTML error. see Forms in HTML documents. or in simple words: always define the action attribute of the form element (it has to point to a file).

regards
Dec 1 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
6027
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that required fields in a form have values. I'm writing the values to the client using document.write only so that I can confirm that the values are there to be played with - this is not the final result so please (unless it's leading to the script failure)...
4
2192
by: Tonya | last post by:
Hi, Does anyone have any example of how i can manage forms in my application?? I want to be able to reference my form instances that are currently open from other forms. why cant i open and close forms as easily as in VB6??
10
19361
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is able to fill that one out just fine. The second form is multipart/form-data. Unfortunately, I haven't been able to fill that out in a way that makes the server happy. I set up a copy of this form at my web site so that I could see exactly what a...
0
1978
by: Pat Patterson | last post by:
I'm having serious issues with a page I'm developing. I just need some simple help, and was hoping someone might be able to help me out in here. I have a form, that consists of 3 pages of fields. I'd like to create a page in which all of this is stored as you move along as hidden variables, until the end, when the user submits. I can't figure out one thing: I have dynamic form elements (dropdowns), that I'd like to use instead of...
25
10268
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
4
1447
by: Dave Guenthner | last post by:
I have a csharp form1.cs created with VS. I have added a menu bar with one option called help. I then created another form in VS called help.cs. How can I launch the help form from the main form called form1. Seems simple. private void menuItem5_Click(object sender, System.EventArgs e) { // Menuitem5_Click is the help menu item user sees
10
6921
by: Kathy Burke | last post by:
HI. in asp.net app, I have an xmlDocument that I transform to the client html. Using xsl I create a few textboxes to capture user input. Each of these are related to <data> elements in the xmlDoc. I want to use the Forms collection to post the html form back to an asp.net page, and process each request.form object (textbox) via an xml node.value update. For any given xmlDocument there is an unknown number of items resulting in...
13
3942
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that .NET creates i get the following error message: "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in VisioTimeline.exe
9
12853
by: mohit.akl | last post by:
Hey guys & gals I am havng trouble modifying the control box. I want to make the maximise button invisible and have minimisise button instead of it. Like this _ X (not like _ o X ) How to do this... and eventually i want to modify the control box in the form of ? _ X ... I.e. adding a new button to control box. I need to detect the click events.
9
3878
by: MikeB | last post by:
Hi, I'd appreciate some help, please. I'm writing a VS2005 VB project for school and one of the requirements is that every screen should have a "Help" button. I could do it by writing a clumsy case statement like this: sub showHelp(byval frm as String) Select Case (frm) Case "Form1" dim help as new Form1
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.