• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Problems with form 2 email


OSNN Addict
My problems are probably quite simple and I'm just overlooking them. I've created a form with a submit button that is only to be enabled once you agree to the terms, but it si refusing to work properly for me. The button is enabled once the page loads and disables when you check the box, which is completely backwards. The second problem is the submit button is not processing like it should. Instead of the form being emailed and a new page loading, nothing happens. The problems can be seen here. http://immixdesigns.net/test/job_form/form.php

Thanks for any help.


OSNN Addict
Thanks for the reply. I did what you suggested with the needed results. Now my problem is the button isn't working. I click on it and nothing happens. Here is the beginning code for my form
<form action="process_form.php" method="post" enctype="text/plain" name="applicationForm"  >
and for my button
<input type="button" name="submitButton" value="Submit" disabled="true" >
From my understanding, clicking on the button should move to the process_form.php, which has all the email commands, and post all fields to their assigned variables and an email should be sent in a readable format due to this command: enctype/text. Am I understanding this correctly?


OSNN Addict
As I expected, simple errors that I just overlooked. Thank you for your help. Now time for me to see if I can handle the rest of it. Thanks again.

Now I've run across a problem on the email side. I can get the email to be sent, but it lists the Send To email twice, the subject line is incomplete and all fields are not included; only nonvariable characters are seen.

Here is the PHP code.
/* recipients */
$to1  = 'emailaddress@email.com';
/* email subject line */
$subject1 = "Application for Employment for $name1";
/* message */
$name1 = $_POST ['name'];
$ssn1 = $_POST ['ssn'];
$dob1 = $_POST ['dob'];
$email1= $_POST ['email'];
$message1 = "NAME:". $name1 ."\r\n";
$message1 .= "SSN:". $ssn1 ."\r\n";
$message1 .= "Date of Birth:". $dob1 ."\r\n";
$message1 .= "Email Address:". $email1 ."\r\n";
/* additional headers */
$headers1 .= "To: ". $to1 ."\r\n";
$headers1 .= "From: ". $email1 ."\r\n";
$headers1 .= "Reply-To: ". $email1 ."\r\n";
mail($to1, $subject1, $message1, $headers1)
Now this is my understanding, which isn't much since I'm new to PHP, and I'm following a variety of sites to build this:
$to1 is the sendto email address, but do not understand why it lists the address twice on the email. It displays as To: email; email.

$subject1 is the email subject, which should display as application for employment from $name1, but it does not display the $name1 variable.

$headers1 is self explanatory, but does not display at all in the email.

$message1 is the the body of the email, which only displays and executes everything in quotations, but no info is passed from the variables.
Last edited:
I have this on a form I developed for work:

if (mail($recipient,$subject,$mail_body,"From: " . $details['E-mail'] . "\r\nReply-To: " . $details['Email'] . "\r\n"))
I also notice you're putting the recipient in the headers as well :)


OSNN Addict
I read about the input sanitization and noticed that is applies to PHP 5.2. This server is running PHP 4.3.11, so adding the sanitization only brings errors. If I understand correctly, the sanitization is used to "clean" the input data so it is readable or meets a set format in the email. I receive emails fine but it seems that the variables are not being set with the info entered into the form. Thanks for your constant help, LordOfLA.
sanitisation also removes in code injection from the variable too.

The server must not be running PHP4 it was EOL in January and its security support stops 8th of August at the latest. Any scripts not supporting PHP5 should be scrapped.

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member