PHP Form not filling in header info

Posted on 2011-10-13
Last Modified: 2013-12-13
I have the following codes for a simple contact email form. The forms get sent correctly, however none of the header info is included. No sent from, subject and so on. Can someone take a look at tell me what is wrong?


	$to = '';
	$subject = $_POST['inquiryOptions'];
	$header = $_POST['emailAddress'];
	$message = "From: $fullName\nBusiness Name: $businessName\nSender e-mail address: $header\nSender phone number: $phoneNumber\nPreferred method of contact: $contact\nRegarding: $subject\n\nMessage:\n$comment\n";

if ($header==" ") {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";

$success = mail ($to, $subject, $message, "From: <$header>");

if ($success){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=success.html\">";
else {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=failure.html\">";


Open in new window

<form action="emailProcessor.php">
			<td><input name="fullName" size="30" tabindex="1" type="text" /></td>
			<td>Business Name:</td>
			<td><input name="businessName" size="30" tabindex="2" type="text" />&nbsp;</td>
			<td>Phone Number:</td>
			<td><input name="phoneNumber" size="30" tabindex="3" type="text" /></td>
			<td style="height: 29px">E-mail Address:</td>
			<td style="height: 29px"><input name="emailAddress" size="30" tabindex="4" type="text" /></td>
			<td>Preferred Method of Contact:</td>
			<select name="contact" tabindex="5">
			<option selected="selected">Phone</option>
			<td>Type of Inquiry:</td>
			<td><select name="inquiryOptions" tabindex="6">
			<option selected="selected">Technical Question</option>
			<option>Product Question</option>
			<option>Service Question</option>
			<td>What's on your mind?</td>
			<td><textarea cols="70" name="comment" rows="8" tabindex="7"></textarea></td>
			<input name="submit" tabindex="8" type="submit" value="Submit" />&nbsp;
			<input name="reset" tabindex="9" type="reset" value="Reset" /></td>


Open in new window

Question by:warsawtech
    LVL 7

    Accepted Solution


    <form action="emailProcessor.php">


    <form action="emailProcessor.php" method="post">

    By default, the method is GET, so nothing in POST to read ...

    LVL 2

    Author Closing Comment

    Awesome. I knew it was something simple! Thanks for the quick reply.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
    The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
    The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now