I have created a form - my first attempt and when I tested it, there was a Parse error: syntax error, unexpected T_STRING on line 25. I have read through the posts here and don't know what to do next? Help anyone??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is caused most often because a form field name is chosen with a name that starts with a numeric character, like 1name, in stead of name1.
All form field names must start with a letter.
Another common reason for this error is that after modifying the proceesor file, there is still a syntax error. This I can not help with unless I see the file as there are many ways this can occur.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the exact same error on a newly created form. There are no form fields I can see that begin $1fieldname (dollar symbol then some number and finally text). Are there any other places too look?
thanks!
-Steve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
mail("steve@rippde.com","phpFormGenerator - Form submission","Form data:
Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
powered by phpFormGenerator.
");
$fileLine = "Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
";
$filename = '/var/www/stmarystayton.org/itsurvey/itsurvey-results';
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $fileLine) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
fclose($handle);
} else {
echo "The file is not writable";
}
include("confirm.html");
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
mail("steve@rippde.com","phpFormGenerator - Form submission","Form data:
Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
powered by phpFormGenerator.
");
$fileLine = "Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
";
$filename = '/var/www/stmarystayton.org/itsurvey/itsurvey-results';
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $fileLine) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
fclose($handle);
} else {
echo "The file is not writable";
}
include("confirm.html");
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have created a form - my first attempt and when I tested it, there was a Parse error: syntax error, unexpected T_STRING on line 25. I have read through the posts here and don't know what to do next? Help anyone??
This is caused most often because a form field name is chosen with a name that starts with a numeric character, like 1name, in stead of name1.
All form field names must start with a letter.
Another common reason for this error is that after modifying the proceesor file, there is still a syntax error. This I can not help with unless I see the file as there are many ways this can occur.
I have the exact same error on a newly created form. There are no form fields I can see that begin $1fieldname (dollar symbol then some number and finally text). Are there any other places too look?
thanks!
-Steve
Here is processor.php
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
// Checkbox handling
$field_1_opts = $_POST['field_1'][0].",". $_POST['field_1'][1].",". $_POST['field_1'][2].",". $_POST['field_1'][3].",". $_POST['field_1'][4].",". $_POST['field_1'][5];
// Checkbox handling
$field_6_opts = $_POST['field_6'][0].",". $_POST['field_6'][1].",". $_POST['field_6'][2].",". $_POST['field_6'][3].",". $_POST['field_6'][4].",". $_POST['field_6'][5].",". $_POST['field_6'][6].",". $_POST['field_6'][7].",". $_POST['field_6'][8];
// Checkbox handling
$field_11_opts = $_POST['field_11'][0].",". $_POST['field_11'][1].",". $_POST['field_11'][2].",". $_POST['field_11'][3].",". $_POST['field_11'][4];
// Checkbox handling
$field_12_opts = $_POST['field_12'][0].",". $_POST['field_12'][1].",". $_POST['field_12'][2].",". $_POST['field_12'][3].",". $_POST['field_12'][4];
mail("steve@rippde.com","phpFormGenerator - Form submission","Form data:
Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
powered by phpFormGenerator.
");
$fileLine = "Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
";
$filename = '/var/www/stmarystayton.org/itsurvey/itsurvey-results';
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $fileLine) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
fclose($handle);
} else {
echo "The file is not writable";
}
include("confirm.html");
?>
Here is processor.php
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
// Checkbox handling
$field_1_opts = $_POST['field_1'][0].",". $_POST['field_1'][1].",". $_POST['field_1'][2].",". $_POST['field_1'][3].",". $_POST['field_1'][4].",". $_POST['field_1'][5];
// Checkbox handling
$field_6_opts = $_POST['field_6'][0].",". $_POST['field_6'][1].",". $_POST['field_6'][2].",". $_POST['field_6'][3].",". $_POST['field_6'][4].",". $_POST['field_6'][5].",". $_POST['field_6'][6].",". $_POST['field_6'][7].",". $_POST['field_6'][8];
// Checkbox handling
$field_11_opts = $_POST['field_11'][0].",". $_POST['field_11'][1].",". $_POST['field_11'][2].",". $_POST['field_11'][3].",". $_POST['field_11'][4];
// Checkbox handling
$field_12_opts = $_POST['field_12'][0].",". $_POST['field_12'][1].",". $_POST['field_12'][2].",". $_POST['field_12'][3].",". $_POST['field_12'][4];
mail("steve@rippde.com","phpFormGenerator - Form submission","Form data:
Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
powered by phpFormGenerator.
");
$fileLine = "Which technologies do you use?: $field_1_opts
What suggestions for improvement do you have on any/all of these technologies?: " . $_POST['field_2'] . "
What should be the most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_3'] . "
What should be the second most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_4'] . "
What should be the third most important consideration in obtaining and implementing technology at our school?: " . $_POST['field_5'] . "
All students should be taught (check all that apply):: $field_6_opts
If you checked "Other" above, please clarify:: " . $_POST['field_7'] . "
Are there any additional technology related subjects that should be taught or offered at our school?: " . $_POST['field_8'] . "
I like our email system.: " . $_POST['field_9'] . "
Please provide and comments you might have on our email system:: " . $_POST['field_10'] . "
Which Email (Google Apps) applications do you use (check all that apply):: $field_11_opts
Which OpenOffice Applications do you use (check all that apply);: $field_12_opts
I like OpenOffice.: " . $_POST['field_13'] . "
Please provide any comments you might have on OpenOffice:: " . $_POST['field_14'] . "
I like Centre.: " . $_POST['field_15'] . "
Please provide and comments you might have on Centre:: " . $_POST['field_16'] . "
Is the technology personnel adequate?: " . $_POST['field_17'] . "
Do you have any comments about the technology personnel?: " . $_POST['field_18'] . "
";
$filename = '/var/www/stmarystayton.org/itsurvey/itsurvey-results';
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $fileLine) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
fclose($handle);
} else {
echo "The file is not writable";
}
include("confirm.html");
?>