Have you tried recreating the form direct from the generator without any modifications?
Since php parse is done on the server where php is run it is hard to tell what your issue is. If you would like me to evaluate what you have, send me your process.php file.
The problem is not likely your form but I can check this to.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Comments/Suggestions:
1.)Not a good idea to use numbers as the first character in a variable name (ever).
2.)Go to line 25 and separate the questionsorcomments character replacement from the if statement. Add CR after "$QuestionsorComments);", and just before the "if".
3.)Change all ${number...} to ${letter...}. You will need to change the form, the process.php, and and data/sql file. This may not be simple but its not good practice to use numbers as the first character in a variable name.
Following number 2 will help further identify the source of the problem. You could also separate the if statement into 2 separate if statements (one with all variables that start with letters, the other with variables that start with numbers). One explanation for the same form working on one server and not another would be that an older version of php might be more tolerant of the defined variable syntax listed below (Reference Material).
Following number 3 will probably solve the issue.
I'm not sure how the numbers appeared.
1: ".$one."
Should have been
one: ".$one."
You can try editing the process.php file to reflect this but I recomend trying to recreate the form from the generator first to see if the error is repeatable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Whatever you end up with the php file has constraints just like variable names. One constraint is that lines should not start with numbers. This causes a problem for the php interpreter.
In your case if you have edited the form.html so that numbers are displayed you can avoid the process.php error on this line by not using a number. Leave the one: ".$one.", this is just a formatted message that is returned when the form is submitted.
Near the bottom:
$message = stripslashes($message);
mail("name@mydomain.com","Form Submitted at your website",$message,"From:
phpFormGenerator");
You can see here that the $message is what has been created and will be sent to you via the mail command.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
form seems to be ok.... not my first form... get error
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/brookt2/public_html/forms/use/hdpxco/process.php on line 25
any and all help appreciated.... checked all folder/file permissions
thanks in advance
form located
http://www.brookt.com/forms/use/hdpxco/form1.html
Have you tried recreating the form direct from the generator without any modifications?
Since php parse is done on the server where php is run it is hard to tell what your issue is. If you would like me to evaluate what you have, send me your process.php file.
The problem is not likely your form but I can check this to.
Comments/Suggestions:
1.)Not a good idea to use numbers as the first character in a variable name (ever).
2.)Go to line 25 and separate the questionsorcomments character replacement from the if statement. Add CR after "$QuestionsorComments);", and just before the "if".
3.)Change all ${number...} to ${letter...}. You will need to change the form, the process.php, and and data/sql file. This may not be simple but its not good practice to use numbers as the first character in a variable name.
Following number 2 will help further identify the source of the problem. You could also separate the if statement into 2 separate if statements (one with all variables that start with letters, the other with variables that start with numbers). One explanation for the same form working on one server and not another would be that an older version of php might be more tolerant of the defined variable syntax listed below (Reference Material).
Following number 3 will probably solve the issue.
Reference Material:
http://us3.php.net/language.variables
"A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores."
Are you having any luck yet?
I get this exact same error and I`m not using any numbers in the names
PHP Parse error: parse error, unexpected T_DNUMBER, expecting T_VARIABLE or '$' in /home/cbsprod/public_html/cbsqa/process.php on line 82
The form is below and I get the error on the line "1: ".$one.""
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','firstname');
pt_register('POST','lastname');
pt_register('POST','company');
pt_register('POST','phone');
pt_register('POST','email');
pt_register('POST','cemail');
pt_register('POST','country');
pt_register('POST','url');
pt_register('POST','msserver2k3');
pt_register('POST','xpprohome');
pt_register('POST','xptablet');
pt_register('POST','win2k');
pt_register('POST','winother');
pt_register('POST','macosxtiger');
pt_register('POST','macosxpanther');
pt_register('POST','macosxother');
pt_register('POST','msie');
pt_register('POST','firefox');
pt_register('POST','safari');
pt_register('POST','konqueror');
pt_register('POST','netscape');
pt_register('POST','mozilla');
pt_register('POST','opera');
pt_register('POST','other');
pt_register('POST','individual');
pt_register('POST','team');
pt_register('POST','multisite');
pt_register('POST','one');
pt_register('POST','two');
pt_register('POST','three');
pt_register('POST','five');
pt_register('POST','seven');
pt_register('POST','agree1');
pt_register('POST','agree2');
pt_register('POST','agree3');
if($firstname=="" || $lastname=="" || $email=="" || $cemail=="" || $country=="" || $url=="" || $agree1=="" || $agree2=="" || $agree3=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$cemail)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="firstname: ".$firstname."
lastname: ".$lastname."
company: ".$company."
phone: ".$phone."
email: ".$email."
cemail: ".$cemail."
country: ".$country."
url: ".$url."
msserver2k3: ".$msserver2k3."
xpprohome: ".$xpprohome."
xptablet: ".$xptablet."
win2k: ".$win2k."
winother: ".$winother."
macosxtiger: ".$macosxtiger."
macosxpanther: ".$macosxpanther."
macosxother: ".$macosxother."
msie: ".$msie."
firefox: ".$firefox."
safari: ".$safari."
konqueror: ".$konqueror."
netscape: ".$netscape."
mozilla: ".$mozilla."
opera: ".$opera."
other: ".$other."
individual: ".$individual."
team: ".$team."
multisite: ".$multisite."
1: ".$one."
2: ".$two."
3: ".$three."
5: ".$five."
7: ".$seven."
agree1: ".$agree1."
agree2: ".$agree2."
agree3: ".$agree3."
";
$message = stripslashes($message);
mail("name@mydomain.com","Form Submitted at your website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.mydomain.com/formsub.php");
?><?php
}
?>
Some info on variable names in php.
http://us3.php.net/language.variables
I'm not sure how the numbers appeared.
1: ".$one."
Should have been
one: ".$one."
You can try editing the process.php file to reflect this but I recomend trying to recreate the form from the generator first to see if the error is repeatable.
Whatever you end up with the php file has constraints just like variable names. One constraint is that lines should not start with numbers. This causes a problem for the php interpreter.
In your case if you have edited the form.html so that numbers are displayed you can avoid the process.php error on this line by not using a number. Leave the one: ".$one.", this is just a formatted message that is returned when the form is submitted.
Near the bottom:
$message = stripslashes($message);
mail("name@mydomain.com","Form Submitted at your website",$message,"From:
phpFormGenerator");
You can see here that the $message is what has been created and will be sent to you via the mail command.