Problems with form 2 email

ziptrx

OSNN Addict
Joined
7 Jan 2004
Messages
53
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.
 
disable the button by default. (enabled="false" in the html)

THen just flip the button state when the check box is clicked.
 
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
Code:
<form action="process_form.php" method="post" enctype="text/plain" name="applicationForm"  >
and for my button
Code:
<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?
 
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.

[ADD]
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.
Code:
<?php
/* 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:

Code:
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 :)
 
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.
 
Found out the problem was caused by this: enctype="text/plain". Thanks again for taking the time to help.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back