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. - $Dept = $_REQUEST['Department'];
-
$First = $_REQUEST['firstname'];
-
$Last = $_REQUEST['lastname'];
-
$Com = $_REQUEST['company'];
-
$Acc = $_REQUEST['account'];
-
$Add = $_REQUEST['adderss'];
-
$City = $_REQUEST['city'];
-
$State = $_REQUEST['state'];
-
$Zip = $_REQUEST['zip'];
-
$Phone = $_REQUEST['phone'];
-
$Email = $_REQUEST['email'];
-
$Help = $_REQUEST['help'];
-
$Sub = $_REQUEST['subject'];
-
$Mess = $_REQUEST['message'];
-
-
$message = $First." ".$Last."\n";
-
$message .= $Com."\n";
-
$message .= $Acc."\n\n";
-
$message .= $Add."\n";
-
$message .= $City." ".",".$State." ".",".$Zip."\n";
-
$message .= $Phone."\n";
-
$message .= $Email."\n";
-
$message .= $Help."\n\n";
-
$message .= $Mess;
-
-
switch ($Dept)
-
{
-
case "Repair Parts":
-
$email_to = "rlacey", "hrichwine";
-
break;
-
case "Rebuilt Exchange Parts":
-
$email_to="rlacey", "hrichwine";
-
break;
-
case "Conversions & Conversion Kits":
-
$email_to="rlacey", "hrichwine";
-
break;
-
case "Test Equipment & Specialty Items":
-
$email_to="rlacey", "hrichwine";
-
break;
-
case "Test Equipment & Specialty Items":
-
$email_to="rlacey", "hrichwine";
-
break;
-
case "Customer Service":
-
$email_to="rlacey", "hrichwine";
-
break;
-
case "Account Receivable":
-
$email_to="kfatherree", "tfraker";
-
break;
-
case "Accounts Payable":
-
$email_to="jlehman", "tfraker";
-
break;
-
case "Service Schools":
-
$email_to="hrichwine";
-
break;
-
case "Rebuilt Exchange Parts":
-
$email_to="sfrank";
-
break;
-
case "Operations":
-
$email_to="ecowan", "eburkhart";
-
break;
-
case "President":
-
$email_to="bbowman", "hrichwine";
-
break;
-
case "Service Center":
-
$email_to="eburkhart", "ecowan";
-
break;
-
case "Sales / Marketing":
-
$email_to="pjones", "tgasull";
-
break;
-
case "Tech Support":
-
$email_to="dfreet", "ssteinour";
-
break;
-
default:
-
$email_to = "ijimenez"; // fail-safe value
-
}
-
mail( $email_to, "Feedback Form Results", $message, "From: $email" );
Nov 28 '08
17 1947
What kind of file does this need to point to? I'm still somewhat confused. Sorry x.x!
Dormilich 8,658
Recognized Expert Moderator Expert
any file that does form data processing. this includes PHP, ASP, Perl or any Server Side Script Language. but in your case it's the php file you originally posted.
regards
The PHP file that I posted at the beginning is apart of the page that contains the form in. I put the PHP right above the form. So then I would just point it back to itself?
Dormilich 8,658
Recognized Expert Moderator Expert @Nyris
yes. but make sure you do not process the script when loading the page for the first time. this is usually one by a check for post data - if (isset($_POST['send'])) // this should be the name of the submit button
-
{
-
// process form data
-
}
and one more note. when you specify the post protocol for data sending, you should use $_POST instead of $_REQUEST (for security reasons).
I no longer get an error when I hit the send button!!! Getting somewhere, thanks a lot for your help so far Dormilich. I still didn't receive an email from it though, however.
This is how I have it setup now with the above if statement you suggested to me. - <td colspan="2"><div align="center"><input type="submit" value="Send" name="send"/>
-
<?php
-
if (isset($_POST['send'])) // this should be the name of the submit button
-
{
-
$Dept = $_POST['Department'];
-
$First = $_POST['firstname'];
-
$Last = $_POST['lastname'];
-
$Com = $_POST['company'];
-
$Acc = $_POST['account'];
-
$Add = $_POST['adderss'];
-
$City = $_POST['city'];
-
$State = $_POST['state'];
-
$Zip = $_POST['zip'];
-
$Phone = $_POST['phone'];
-
$Email = $_POST['email'];
-
$Help = $_POST['help'];
-
$Sub = $_POST['subject'];
-
$Mess = $_POST['message'];
-
-
$message = $First." ".$Last."\n";
-
$message .= $Com."\n";
-
$message .= $Acc."\n\n";
-
$message .= $Add."\n";
-
$message .= $City." ".",".$State." ".",".$Zip."\n";
-
$message .= $Phone."\n";
-
$message .= $Email."\n";
-
$message .= $Help."\n\n";
-
$message .= $Mess;
-
-
switch ($Dept)
-
{
-
case "Repair Parts":
-
$email_to = "rlacey". "hrichwine";
-
break;
-
case "Rebuilt Exchange Parts":
-
$email_to="rlacey". "hrichwine";
-
break;
-
case "Conversions & Conversion Kits":
-
$email_to="rlacey". "hrichwine";
-
break;
-
case "Test Equipment & Specialty Items":
-
$email_to="rlacey". "hrichwine";
-
break;
-
case "Test Equipment & Specialty Items":
-
$email_to="rlacey". "hrichwine";
-
break;
-
case "Customer Service":
-
$email_to="rlacey". "hrichwine";
-
break;
-
case "Account Receivable":
-
$email_to="kfatherree". "tfraker";
-
break;
-
case "Accounts Payable":
-
$email_to="jlehman". "tfraker";
-
break;
-
case "Service Schools":
-
$email_to="hrichwine";
-
break;
-
case "Rebuilt Exchange Parts":
-
$email_to="sfrank";
-
break;
-
case "Operations":
-
$email_to="ecowan". "eburkhart";
-
break;
-
case "President":
-
$email_to="bbowman". "hrichwine";
-
break;
-
case "Service Center":
-
$email_to="eburkhart". "ecowan";
-
break;
-
case "Sales / Marketing":
-
$email_to="pjones". "tgasull";
-
break;
-
case "Tech Support":
-
$email_to="dfreet". "ssteinour";
-
break;
-
default:
-
$email_to = "ijimenez"; // fail-safe value
-
}
-
mail( $email_to, "Feedback Form Results", $message, "From: $email" );
-
}
-
?>
Dormilich 8,658
Recognized Expert Moderator Expert
if you want to send email to several persons don't forget that the addresses mus be comma-separated. - $email_to="name1@host.tld, name2@host.tld";
maybe a more convenient way to do the email addresses is to store the addresses in an array and call that. - $emails = array("john" => "jdoe@host.tld", "don" => "don.t.worry@host.tld");
-
// and so forth
-
-
switch ($Dept)
-
{
-
case "Repair Parts":
-
$email_to = $emails['don'] . ", " . $emails['john']; break;
-
// ...
-
}
you could also define a constant for each email address - define("EMAIL_ADDR_JDOE", "jdoe@host.tld");
-
// ...
-
$email_to = EMAIL_ADDR_JDOE . ", " . EMAIL_ADDR_DWORRY;
-
though that's only a possibility, I'd go for the array.
if that's not working do a var_dump() on the variables just before sending. this could give you a clue, if a variable has an invalid value.
regards
note: to protect your co-workers from spam, do not post any email addresses. every reasonable editor has a search function that can remove these via a regex. if it's too late to edit, ask a moderator to do it for you.
It works! You're a genius Dormilich. Thanks a lot for your help!
Dormilich 8,658
Recognized Expert Moderator Expert @Nyris
no, I'm a XML god.... kidding. I'm glad I could help, that's why we're here.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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)...
|
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??
|
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...
|
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...
|
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...
| |
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
|
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...
|
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
|
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.
|
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
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |