1.) Check the form.html code near the bottom and make sure that the min/max dates are in the correct orientation. The function expects
function validateDate(fieldId, fieldBoxId, fieldType, required, minDateStr, maxDateStr)
minDate first.
Here is the form you sent me (#918).
validateDate('field_6','fieldBox_6','date',1,'12/31/2015','09/27/2007')
You can see that this would never work as the min is greater than the max. Change this to something like
validateDate('field_6','fieldBox_6','date',1,'12/31/2005','09/27/2017')
This means that you will have to change it again in 2017 unless you make it much further into the future.
2.) Change the middle function validateDate() function
Here is your code from the form you sent me (#918)
currDays = parseInt(dateStr.substr(0,2),10) + parseInt(dateStr.substr(3,2),10)*30 + parseInt(dateStr.substr(6,4),10)*365;
maxDays = parseInt(maxDateStr.substr(0,2),10) + parseInt(maxDateStr.substr(3,2),10)*30 + parseInt(maxDateStr.substr(6,4),10)*365;
minDays = parseInt(minDateStr.substr(0,2),10) + parseInt(minDateStr.substr(3,2),10)*30 + parseInt(minDateStr.substr(6,4),10)*365;
This takes a date in the form of 10/02/2007 and is supposed to calculate the total number of days in that date (days in 10 months + days in 02 days + days in 2007 years).
The idea is that there is
1 day per day
30 days per month
365 days per year
This is not 100% accurate but it works for calculating if you are between min max dates where the range is very large.
As you can see the *30 for the month operates on the day field of the date. So the solution here is to move the *30 to the first field like this
currDays = parseInt(dateStr.substr(0,2),10)*30 + parseInt(dateStr.substr(3,2),10) + parseInt(dateStr.substr(6,4),10)*365;
maxDays = parseInt(maxDateStr.substr(0,2),10)*30 + parseInt(maxDateStr.substr(3,2),10) + parseInt(maxDateStr.substr(6,4),10)*365;
minDays = parseInt(minDateStr.substr(0,2),10)*30 + parseInt(minDateStr.substr(3,2),10) + parseInt(minDateStr.substr(6,4),10)*365;
I will make a note of this with the developer and make sure the necessary corrections are made for future forms.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your help and looking this over. I tried the date bothways before with it not working correctly. The changes you suggested seems to work fine.
Thanks again,
Joseph White
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All Robots or Spamer without JavaScript on Client Browser send Spam with a Form generated from "phpFormGenerator v3.0"?
I can put in all ascii Code and it will be send.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your grammar is really poor. If I don't understand what you are saying, or asking, nobody else will either.
PLease restate your question and try to be very clear.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TNT, will there be any admin functionality on future release, I like the old version for that as it would pull a list from the db to post on my website as files were modified?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree it is a great feature. I hope it will be part of 3.0 but I haven't seen anything yet.
FYI,
The old admin can be used with the dbs created in 3.0 and with just a few minor tweeks it works just as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Append the date to what? It helps if you are more specific when you make requests.
If all you want to do is add the date to the email message then you can add the following code to your processor.php file at the end of your $message variable.
date('l dS \of F Y h:i:s A')
For example:
mail("youremail@yoururl.com","phpFormGenerator - Form submission","Form data:
Name: " . $_POST['field_1'] . "
Phone Number: " . $_POST['field_2'] . "
Date: ".date('l dS \of F Y h:i:s A')."
powered by phpFormGenerator.
");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is the code when you want to compare two e-mail address fields to make sure they are the same. We get a lot of typos in e-mail addresses and would like to have the person retype their e-mail address on a second line and then for the two e-mails to be compared before the form is mailed.
Thanks for any assistance,
Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's never rocket science. Be sure to make note of line numbers in error messages so you can identify the exact line number where the error is being identified.
The error message you were seeing is typically due to some other failure but invalid syntax can still confuse the compiler.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe this wil help. It is a snippet of the code from the Process.php
file:
......
pt_register('POST','Homephone');
pt_register('POST','Workphone');
pt_register('POST','Email1');
pt_register('POST','Email2');
if($Email1 == $Email2)
{echo "OK";)
else {
print "The e-mails do not match, please re-enter";}
pt_register('POST','JobDescription');
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
......
Hope this helps.
Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
line 10 pt_register('POST','Homephone');
line 11 pt_register('POST','Workphone');
line 12 pt_register('POST','Email1');
line 13 pt_register('POST','Email2');
line 14 if($Email1 == $Email2)
line 15 {echo "OK";)
line 16 else {
line 17 echo "The e-mails do not match, please re-enter";}
line 18 pt_register('POST','JobDescription');
line 19 if($errors==1) echo $error;
line 20 else{
line 21 $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
line 22 $message="Name: ".$Name."
I now get this message:
"Parse error: parse error, unexpected ')' in /home/oshp/public_html/e-forms/job_payment_form/process.php on line 15"
I hope I'm frustrating you as much as I'm getting frustrated with my coding ability.
thanks,
Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Changed the bracket to match, get this message
"
Parse error: parse error, unexpected ')' in /home/oshp/public_html/e-forms/job_payment_form/process.php on line 15"
If we cannot figure this out this time, I'm gonna stop and go home and
relax . . .
Thanks for all your patience.
Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the same message for the same line number. I suspect you did not change what you think you changed. Of course this is only a guess because I can not see the code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was able to install the form and it works well with Firefox, but when I tried the form with Internet Explorer 6, I get the INVAILD CAPTCHA STRING problem
Any ideas on what might be the problem. It was mentioned above that there might be an issue with how the host handles session. How do I find out?
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Like I said before, I have never seen this issue. Mention it to your host to see if they have any clue. Otherwise it will take some time for us to figure it out.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created php forms on the last version of phpformgen. I am in need of editting these forms to add an email address box. I would like to be able to edit them without recreating them entirely. Any feedback on how to accomplish this?
I got feedback on adding capthca. Very helpful . . . thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First you need to consider if the form is sending data to MySQL. If so, it gets a bit more difficult to add fields manually.
MySQL:
1.) Edit the database to add the new field.
2.) Edit the form.html to include another input field.
3.) Edit the process.php to register the new field and assign a new variable.
4.) Edit the process.php to do any checks, add to SQL, add to email message, and then add to thank you page if used.
File Based DB:
1.) Edit the file db to add another "|" field separator to every line.
2.) Edit the form.html to include another input field.
3.) Edit the process.php to register the new field and assign a new variable.
4.) Edit the process.php to do any checks, add to file db, add to email message, and then add to thank you page if used.
If you still need help let me know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, found the issues.
1.) Check the form.html code near the bottom and make sure that the min/max dates are in the correct orientation. The function expects
function validateDate(fieldId, fieldBoxId, fieldType, required, minDateStr, maxDateStr)
minDate first.
Here is the form you sent me (#918).
validateDate('field_6','fieldBox_6','date',1,'12/31/2015','09/27/2007')
You can see that this would never work as the min is greater than the max. Change this to something like
validateDate('field_6','fieldBox_6','date',1,'12/31/2005','09/27/2017')
This means that you will have to change it again in 2017 unless you make it much further into the future.
2.) Change the middle function validateDate() function
Here is your code from the form you sent me (#918)
currDays = parseInt(dateStr.substr(0,2),10) + parseInt(dateStr.substr(3,2),10)*30 + parseInt(dateStr.substr(6,4),10)*365;
maxDays = parseInt(maxDateStr.substr(0,2),10) + parseInt(maxDateStr.substr(3,2),10)*30 + parseInt(maxDateStr.substr(6,4),10)*365;
minDays = parseInt(minDateStr.substr(0,2),10) + parseInt(minDateStr.substr(3,2),10)*30 + parseInt(minDateStr.substr(6,4),10)*365;
This takes a date in the form of 10/02/2007 and is supposed to calculate the total number of days in that date (days in 10 months + days in 02 days + days in 2007 years).
The idea is that there is
1 day per day
30 days per month
365 days per year
This is not 100% accurate but it works for calculating if you are between min max dates where the range is very large.
As you can see the *30 for the month operates on the day field of the date. So the solution here is to move the *30 to the first field like this
currDays = parseInt(dateStr.substr(0,2),10)*30 + parseInt(dateStr.substr(3,2),10) + parseInt(dateStr.substr(6,4),10)*365;
maxDays = parseInt(maxDateStr.substr(0,2),10)*30 + parseInt(maxDateStr.substr(3,2),10) + parseInt(maxDateStr.substr(6,4),10)*365;
minDays = parseInt(minDateStr.substr(0,2),10)*30 + parseInt(minDateStr.substr(3,2),10) + parseInt(minDateStr.substr(6,4),10)*365;
I will make a note of this with the developer and make sure the necessary corrections are made for future forms.
Thanks for your help and looking this over. I tried the date bothways before with it not working correctly. The changes you suggested seems to work fine.
Thanks again,
Joseph White
Hey Hey..........phpformgen.com is down...... What is happening?
All Robots or Spamer without JavaScript on Client Browser send Spam with a Form generated from "phpFormGenerator v3.0"?
I can put in all ascii Code and it will be send.
Your grammar is really poor. If I don't understand what you are saying, or asking, nobody else will either.
PLease restate your question and try to be very clear.
TNT, will there be any admin functionality on future release, I like the old version for that as it would pull a list from the db to post on my website as files were modified?
I agree it is a great feature. I hope it will be part of 3.0 but I haven't seen anything yet.
FYI,
The old admin can be used with the dbs created in 3.0 and with just a few minor tweeks it works just as well.
I am generating a form with 3.0 and would like to add an action which appends the date automatically when the form is submitted. Can it be done?
k
Append the date to what? It helps if you are more specific when you make requests.
If all you want to do is add the date to the email message then you can add the following code to your processor.php file at the end of your $message variable.
date('l dS \of F Y h:i:s A')
For example:
mail("youremail@yoururl.com","phpFormGenerator - Form submission","Form data:
Name: " . $_POST['field_1'] . "
Phone Number: " . $_POST['field_2'] . "
Date: ".date('l dS \of F Y h:i:s A')."
powered by phpFormGenerator.
");
What is the code when you want to compare two e-mail address fields to make sure they are the same. We get a lot of typos in e-mail addresses and would like to have the person retype their e-mail address on a second line and then for the two e-mails to be compared before the form is mailed.
Thanks for any assistance,
Ben
In it's simplest form
if($a == $b)
echo "OK";
else
echo "NOTOK";
If your not a programmer you can search the web for example code. If you still have trouble come back and post again.
I added this -
if($Email1 === $Email2)
{echo "OK"}
else {
print "The e-mails do not match, please re-enter";}
I get this error message -
Parse error: parse error, unexpected T_STRING in /home/oshp/public_html/e-forms/job_payment_form/process.php on line 14
Not sure what I've done wrong.
Thanks,
Ben
==
not
===
Changed from === to ==, but I still get the same message.
Ben
{echo "OK"}
to
{echo "OK";}
It's never rocket science. Be sure to make note of line numbers in error messages so you can identify the exact line number where the error is being identified.
The error message you were seeing is typically due to some other failure but invalid syntax can still confuse the compiler.
Maybe this wil help. It is a snippet of the code from the Process.php
file:
......
pt_register('POST','Homephone');
pt_register('POST','Workphone');
pt_register('POST','Email1');
pt_register('POST','Email2');
if($Email1 == $Email2)
{echo "OK";)
else {
print "The e-mails do not match, please re-enter";}
pt_register('POST','JobDescription');
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
......
Hope this helps.
Ben
No it does not.
Message is what?
Line number is what?
What is on this line?
If that line looks OK, what is on previous lines?
Information overload is better than trying to guess at what might help me solve your problem.
The only other thing I can see that might not work is the print statement. Try using echo instead.
line 10 pt_register('POST','Homephone');
line 11 pt_register('POST','Workphone');
line 12 pt_register('POST','Email1');
line 13 pt_register('POST','Email2');
line 14 if($Email1 == $Email2)
line 15 {echo "OK";)
line 16 else {
line 17 echo "The e-mails do not match, please re-enter";}
line 18 pt_register('POST','JobDescription');
line 19 if($errors==1) echo $error;
line 20 else{
line 21 $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
line 22 $message="Name: ".$Name."
I now get this message:
"Parse error: parse error, unexpected ')' in /home/oshp/public_html/e-forms/job_payment_form/process.php on line 15"
I hope I'm frustrating you as much as I'm getting frustrated with my coding ability.
thanks,
Ben
{echo "OK";)
opening and closing brackets are different
change to
{echo "OK";}
Changed the bracket to match, get this message
"
Parse error: parse error, unexpected ')' in /home/oshp/public_html/e-forms/job_payment_form/process.php on line 15"
If we cannot figure this out this time, I'm gonna stop and go home and
relax . . .
Thanks for all your patience.
Ben
This is the same message for the same line number. I suspect you did not change what you think you changed. Of course this is only a guess because I can not see the code.
I was able to install the form and it works well with Firefox, but when I tried the form with Internet Explorer 6, I get the INVAILD CAPTCHA STRING problem
Any ideas on what might be the problem. It was mentioned above that there might be an issue with how the host handles session. How do I find out?
thanks
Like I said before, I have never seen this issue. Mention it to your host to see if they have any clue. Otherwise it will take some time for us to figure it out.
I created php forms on the last version of phpformgen. I am in need of editting these forms to add an email address box. I would like to be able to edit them without recreating them entirely. Any feedback on how to accomplish this?
I got feedback on adding capthca. Very helpful . . . thanks!
First you need to consider if the form is sending data to MySQL. If so, it gets a bit more difficult to add fields manually.
MySQL:
1.) Edit the database to add the new field.
2.) Edit the form.html to include another input field.
3.) Edit the process.php to register the new field and assign a new variable.
4.) Edit the process.php to do any checks, add to SQL, add to email message, and then add to thank you page if used.
File Based DB:
1.) Edit the file db to add another "|" field separator to every line.
2.) Edit the form.html to include another input field.
3.) Edit the process.php to register the new field and assign a new variable.
4.) Edit the process.php to do any checks, add to file db, add to email message, and then add to thank you page if used.
If you still need help let me know.