...

View Full Version : parse error for emailform



surreal5335
05-15-2008, 06:26 PM
I am creating a script to process email forms. So far I have run into this error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/surreal/public_html/emailform.php on line 23

This is code surrounding line 23

20: foreach ($_POST as $key => $value) {
21: $key = clear_user_input($key);
22: $value = clear_user_input($value);
23: if ($key--'extra'){
24: if (is_array($POST['extras']))}
25: $body .= "key: ";
26: $counter =1;
27: foreach($_POST['extras'] as $value) {
28: //Add comma and space until last element
29: if (sizeof($_POST['extras']) == $counter) {
30: $body .= "$value\n";
31: break;}
32: else {
33: $body .= "$value, ";
34: $counter += 1;
35: }}
36: } else{
37: $body .= "$key: $value\n";
38: }

I appreciate any help you can give me

Leeoniya
05-15-2008, 06:30 PM
line 23 makes no sense, it should probably be


if ($key=='extra'){



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum