View Full Version : form problems. pls help
urluckee
01-29-2008, 08:21 PM
Why doesn't include the contents of the submittion (only the labels)? THXXXX
<?php
$totalcomments.="Company:".$company."\n\n";
$totalcomments.="New_or_existing:".$new_or_existing."\n\n";
$totalcomments.="Allocated_or_pooled:".$allocated_or_pooled."\n\n";
$totalcomments.="Profit_sharing:".$profit_sharing."\n\n";
$totalcomments.="Profit_share_allocation_method:".$profit_share_allocation_method."\n\n";
$totalcomments.="Employer:".$employer."\n\n";
$totalcomments.="Number_of_employers:".$number_of_employers."\n\n";
$totalcomments.="Name:".$name."\n\n";
$totalcomments.="Email:".$email."\n\n";
$totalcomments.="Phone:".$phone."\n\n";
$notify_email = "dave@sozopivotal.com";
//$notify_email = "dave@sozopivotal.com";
$notify_subject = "Thank you!";
$notifyadmin_subject = "Request for Quote";
$notify_user = "Thanks for the submission ";
//$from = "dave@sozopivotal.com";
$from = "dave@sozopivotal.com";
$notify_message = "There is feedback";
$visitor_message = "Thank you for requesting a quote. At Applied Plan Administrators we look forward to serving you. If you have any questions, please do not hesitate to contact us at 248.645.6145 or via email at info@appliedplan.com.
";
mail( "$email", "$notify_subject", "$visitor_message", "From: $from");
mail( "$notify_email", "$notifyadmin_subject", "$totalcomments", "From: $email");
//mail( "$mailto", "$subject", "$message", "From: $from");
header("Location:http://www.appliedplan.com/new_site/thankyou.html");
exit();
?>
djr33
01-29-2008, 10:43 PM
$message is not set to any value. So, yeah, you get no message. It looks like you should use $totalcomments or change that name to $message.
You also don't need to place the values in quotes like that. "$email" is just extra work for the parser-- using $email will do the same thing. That's true of all of it, except for the strings (text) of course. Oddly, though, you escape from the quotes for adding the variables nearer the top-- you don't need to, if you're using double quotes. You also need double quotes for the \n characters. But you could use the faster single quotes for the first part of those.
Another problem you'll run into if you use full error checking is that $totalcomments is not set at the beginning and you try to add to it. the .= command is not really a command in itself but a shortcut-- it means $a = $a.'this';, so you are adding the old value of $totalcomments to the new data, and there was no old value, so that's wrong. Anyway, to fix it you should begin with =, then use .= once it is set.
urluckee
01-30-2008, 08:23 PM
Thanks so much. Ok, I didn't understand what you said to do with \n. Also, would you mind looking to see if this is right:
<?php
$totalcomments = $totalcomments.'Company:'.$company. "\n\n";
$totalcomments = $totalcomments.'New_or_existing:'.$new_or_existing."\n\n";
$totalcomments = $totalcomments.'Allocated_or_pooled:'.$allocated_or_pooled."\n\n";
$totalcomments = $totalcomments.'Profit_sharing:'.$profit_sharing."\n\n";
$totalcomments = $totalcomments.'Profit_share_allocation_method:'.$profit_share_allocation_method."\n\n";
$totalcomments = $totalcomments.'Employer:'.$employer."\n\n";
$totalcomments = $totalcomments.'Number_of_employers:'.$number_of_employers."\n\n";
$totalcomments = $totalcomments.'Name:'.$name."\n\n";
$totalcomments = $totalcomments.'Email:'.$email."\n\n";
$totalcomments = $totalcomments.'Phone:'.$phone."\n\n";
$notify_email = "dave@sozopivotal.com";
//$notify_email = "dave@sozopivotal.com";
$notify_subject = "Thank you!";
$notifyadmin_subject = "Request for Quote";
$notify_user = "Thanks for the submission ";
//$from = "dave@sozopivotal.com";
$from = "dave@sozopivotal.com";
$notify_message = "There is feedback";
$visitor_message = "Thank you for requesting a quote. At Applied Plan Administrators we look forward to serving you. If you have any questions, please do not hesitate to contact us at 248.645.6145 or via email at info@appliedplan.com.
";
urluckee
01-30-2008, 08:24 PM
Please double check.
Thanks soooooooo much for your help thus far!!!
<?php
$totalcomments = $totalcomments.'Company:'.$company. "\n\n";
$totalcomments = $totalcomments.'New_or_existing:'.$new_or_existing."\n\n";
$totalcomments = $totalcomments.'Allocated_or_pooled:'.$allocated_or_pooled."\n\n";
$totalcomments = $totalcomments.'Profit_sharing:'.$profit_sharing."\n\n";
$totalcomments = $totalcomments.'Profit_share_allocation_method:'.$profit_share_allocation_method."\n\n";
$totalcomments = $totalcomments.'Employer:'.$employer."\n\n";
$totalcomments = $totalcomments.'Number_of_employers:'.$number_of_employers."\n\n";
$totalcomments = $totalcomments.'Name:'.$name."\n\n";
$totalcomments = $totalcomments.'Email:'.$email."\n\n";
$totalcomments = $totalcomments.'Phone:'.$phone."\n\n";
$notify_email = "dave@sozopivotal.com";
//$notify_email = "dave@sozopivotal.com";
$notify_subject = "Thank you!";
$notifyadmin_subject = "Request for Quote";
$notify_user = "Thanks for the submission ";
//$from = "dave@sozopivotal.com";
$from = "dave@sozopivotal.com";
$notify_message = "There is feedback";
$visitor_message = "Thank you for requesting a quote. At Applied Plan Administrators we look forward to serving you. If you have any questions, please do not hesitate to contact us at 248.645.6145 or via email at info@appliedplan.com.
";
djr33
01-30-2008, 10:16 PM
Hmm... why did you post it twice in a row within one minute?
Please use
tags when posting. That makes it a lot easier to read. Anyway, you use the = for the first, then .= from then on.
Use:[code]
$totalcomments = $totalcomments.'Company:'.$company. "\n\n";
$totalcomments .= $totalcomments.'New_or_existing:'.$new_or_existing."\n\n";
$totalcomments .= $totalcomments.'Allocated_or_pooled:'.$allocated_or_pooled."\n\n";
$totalcomments .= $totalcomments.'Profit_sharing:'.$profit_sharing."\n\n";
//etc
thetestingsite
01-30-2008, 10:30 PM
Something else you may want to make sure of is that the variables you are calling to make up the message in $totalcomments are being assigned a value before being passed to the script. Whether it be using $_GET, $_POST, $_REQUEST, $_COOKIE, or $_SESSION, you should call your variables like this as to not get any errors.
Hope this helps.
urluckee
02-06-2008, 02:16 PM
Hi, thanks but still the same problem. I don't know what the problem is.
urluckee
02-06-2008, 02:35 PM
<form action="http://www.sozopivotal.com/apa/form.php" method="post" name="FormName">
<p><strong>Company Name:</strong> <input type="text" name="company" size="24" /></p>
<p><strong>Please describe your plan</strong><br />
<input type="radio" name="new_or_existing" value="new" /> New<br />
<input type="radio" name="new_or_existing" value="existing" /> Existing</p>
<p><strong>Number of participants with balances: </strong><input type="text" name="number_of_participants" size="5" /></p>
<p><input type="radio" name="allocated_or_pooled" value="allocated" /> Allocated Account<br />
<input type="radio" name="allocated_or_pooled" value="pooled" /> Pooled Account</p>
<p><input type="radio" name="profit_sharing:" value="only" /> Profit Sharing only<br />
<input type="radio" name="profit_sharing:" value="with_401k" /> Profit Sharing with 401(k)</p>
<p><strong>Profit Sharing Allocation Method:</strong><br />
<input type="radio" name="profit_share_allocation_method" value="integrated" /> Integrated with Social Security<br />
<input type="radio" name="profit_share_allocation_method" value="new_comp" /> New Comparability<br />
<input type="radio" name="profit_share_allocation_method" value="age_weighted" /> Age Weighted</p>
<p><input type="radio" name="employer" value="multiple" /> Multiple Employer<br />
<input type="radio" name="employer" value="single" /> Single Employer</p>
<p><strong>If multiple employer, number of participating employers: </strong><input type="text" name="number_of_employers" size="5" /></p>
<p><strong>Send quote to:</strong></p>
<p>Name: <input type="text" name="name" size="24" /></p>
<p>Email: <input type="text" name="email" size="24" /></p>
<p>Phone: <input type="text" name="phone" size="24" /></p>
<input type="submit" name="submitButtonName" value="Submit">
</form>
<p></p>
</td>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.