Hi, I thought everything was finally working! Up until now visitors could send me mail ans I received them. But I asked my friends to test the form for me, and one of them sees the following while entering her mailadress :
The following errors occured while processing your form input. Invalid email address entered
It's a hotmail-adress and I think it must be the _ sign within her adress? All the other hotmailadresses work correctly.
What can I do to make the form work with this '_' in the mailadresses??
Hope you can help, I made the site for a pub, so it needs to work!
(p.s. hope my English is ok, I'm Dutch)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The email address check is pretty standard. It does allow the "_" character. In most cases an error occurs due to a leading or trailing space. Try adding this to your process.php file just before the address check:
$email = trim($email);
This assumes your variable name for the email adderss is "$email".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, just made the changes an uploaded it all, but the mailadress with _@hotmail.com still doesn't work, the same message appears that it's an invalid email adress.
Do you have any other ideas?
I thought about making a new form, and make the Email a text box instead of an 'E-mail'. Or is that not a good idea? Or if it is an good idea, can I also change this in the existing form so that I don't have to make a new one?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Give me the email address. If you don't want to send the exact email address do this;
replace letters with letters, numbers with numbers, use all exact special characters . _ etc..
I you want to send the exact email don't post it here, send it to me in an email.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I must be doing something wrong, I followed your steps, uploaded again, but it still doesn't work... I think I'm making a mess of it, and PHP is totally new for me, but I want to learn!
This is the first part of the process.php. file now:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Naam');
pt_register('POST','Email');
$Email=trim($Email);
pt_register('POST','Telefoonnummer');
pt_register('POST','Website');
pt_register('POST','Vragenofopmerkingen');
$Vragenofopmerkingen=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Vragenofopmerkingen);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;
}
Since I didn't know for sure where to put all the files exactly, I have the 'public html-folder', where I put the projectfiles, but in this public html-folder I also have the folders 'phpform', 'admin' and 'files'. Within these folders are also the process.php and form1. I made the changes in all 3 process.php files in the different folders.
So I have some things 'double', do you know what I mean? I can probably delete some of them, but I would like the form working correctly before I look into that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First of all you should only modify the process.php file that is in the same directory as the form you wish to modify (Nothing else!).
Second it looks like you put the modification in the right place.
I tested this modification myself so I know it works. Maybe you are not modifying the right file.
The phpform directory is where the form generator is located.
The phpform/forms/use directory is where new forms are put by the generator. For instance, if your form name was MyForm it would be located in the directory named
phpform/forms/use/MyForm
You will find the form1.html and the process.php file in this folder along with a number of other files and folders. This is where you should be making your modifications.
Send me a link to your form.
Add this text to your process.php file.
Replace this line
$error.="<li>Invalid email address entered";
with this line
$error.="<li>Invalid email address entered:".$Email;
When you enter an invalid email the next time you should see the wrong email addres appear after the Invalid... text. If this does not occur you have modified the wrong file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, when I was testing I added one underscore that I know would work with the old check function. Then I added the second underscore to check the new function. What I failed to do is remove the first underscore after testing the second successfully. The failure occured again because you only had one trailing underscore (the condition I missed).
Try this modification to the last check function.
Change the email check function to this:
The modification is in the 3rd set of []'s.
I'm becoming crazy, I still get the message with the entered mailadress in it. I don't know if you need to see it, but I'll paste my process.php again:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Naam');
pt_register('POST','Email');
$Email=trim($Email);
pt_register('POST','Telefoonnummer');
pt_register('POST','Website');
pt_register('POST','Vragenofopmerkingen');
$Vragenofopmerkingen=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Vragenofopmerkingen);if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+[_\\-]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
$error.="<li>Invalid email address entered:".$Email;
$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="Naam: ".$Naam."
Email: ".$Email."
Telefoonnummer: ".$Telefoonnummer."
Website: ".$Website."
Vragen of opmerkingen: ".$Vragenofopmerkingen."
";
$message = stripslashes($message);
mail("mymail@lycos.nl","Form Submitted at your website",$message,"From: phpFormGenerator");
This is really weird, I also tried the fake mailadress that you used earleir, just to be sure it also works when I try it, her_mail_@hotmail.com... And than one also works, just still not the one I send you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your help anyway! I'll check into Paypal, because I should really donate something after tonight! As long as you try to find the problem :-)
But what's best to do now? Maybe my sister is the only one with such a weird mailadress, but I can't risk the mail not working when unknown visitors get this message while entering their adress...
Create a new form and make it a text box instead of email? Or can I make this change in the existing form?
I hope you'll find the solution when you use this as an test case! I'm actually kind of releived that I wasn't being totally stupid! How will I know if you've found the solution?
Ok, unfortunaly without the solution... it's bedtime, it's 3.15 here and I have to get up early :-(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Amazing! Could it be that I found the solution?? I didn't want to give up, but I don't know anything about PHP and all the codes, so I was just trying some things in de changes you gave me last night. And the first thing I tried was this change:
I deleted the second set of []'s of the last you gave me last night:
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+[_\\-]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
And now I get all the mails from the fake adresses like her_mail_@hotmail.com, her_@hotmail.com, her_mail@hotmail.com. It doesn't seem to matter now where the _ is.
Is this the right modification? Or am I breaking any 'php-rules' with this one?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I thought everything was finally working! Up until now visitors could send me mail ans I received them. But I asked my friends to test the form for me, and one of them sees the following while entering her mailadress :
The following errors occured while processing your form input. Invalid email address entered
It's a hotmail-adress and I think it must be the _ sign within her adress? All the other hotmailadresses work correctly.
What can I do to make the form work with this '_' in the mailadresses??
Hope you can help, I made the site for a pub, so it needs to work!
(p.s. hope my English is ok, I'm Dutch)
The email address check is pretty standard. It does allow the "_" character. In most cases an error occurs due to a leading or trailing space. Try adding this to your process.php file just before the address check:
$email = trim($email);
This assumes your variable name for the email adderss is "$email".
Hi, sorry for another question, but just to be sure I don't mess it up, below is my process.php. Where exactly do you mean?
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Naam');
pt_register('POST','Email');
pt_register('POST','Telefoonnummer');
pt_register('POST','Website');
pt_register('POST','Vragenofopmerkingen');
$Vragenofopmerkingen=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Vragenofopmerkingen);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($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Naam: ".$Naam."
Email: ".$Email."
Telefoonnummer: ".$Telefoonnummer."
Website: ".$Website."
Vragen of opmerkingen: ".$Vragenofopmerkingen."
";
$message = stripslashes($message);
mail("mymail@lycos.nl","Form Submitted at your website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.vincents.nl/bedankt.htm");
?><?php
}
?>
Right after the post will do.
pt_register('POST','Email');
$Email=trim($Email);
Hi, just made the changes an uploaded it all, but the mailadress with _@hotmail.com still doesn't work, the same message appears that it's an invalid email adress.
Do you have any other ideas?
I thought about making a new form, and make the Email a text box instead of an 'E-mail'. Or is that not a good idea? Or if it is an good idea, can I also change this in the existing form so that I don't have to make a new one?
Thanks!
Give me the email address. If you don't want to send the exact email address do this;
replace letters with letters, numbers with numbers, use all exact special characters . _ etc..
I you want to send the exact email don't post it here, send it to me in an email.
I just send you a mail with the exact adress in it.
Change the email check function to this:
The modification is in the 3rd set of []'s.
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9_\\-]+)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
I must be doing something wrong, I followed your steps, uploaded again, but it still doesn't work... I think I'm making a mess of it, and PHP is totally new for me, but I want to learn!
This is the first part of the process.php. file now:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Naam');
pt_register('POST','Email');
$Email=trim($Email);
pt_register('POST','Telefoonnummer');
pt_register('POST','Website');
pt_register('POST','Vragenofopmerkingen');
$Vragenofopmerkingen=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Vragenofopmerkingen);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;
}
Since I didn't know for sure where to put all the files exactly, I have the 'public html-folder', where I put the projectfiles, but in this public html-folder I also have the folders 'phpform', 'admin' and 'files'. Within these folders are also the process.php and form1. I made the changes in all 3 process.php files in the different folders.
So I have some things 'double', do you know what I mean? I can probably delete some of them, but I would like the form working correctly before I look into that.
First of all you should only modify the process.php file that is in the same directory as the form you wish to modify (Nothing else!).
Second it looks like you put the modification in the right place.
I tested this modification myself so I know it works. Maybe you are not modifying the right file.
The phpform directory is where the form generator is located.
The phpform/forms/use directory is where new forms are put by the generator. For instance, if your form name was MyForm it would be located in the directory named
phpform/forms/use/MyForm
You will find the form1.html and the process.php file in this folder along with a number of other files and folders. This is where you should be making your modifications.
Send me a link to your form.
Add this text to your process.php file.
Replace this line
$error.="<li>Invalid email address entered";
with this line
$error.="<li>Invalid email address entered:".$Email;
When you enter an invalid email the next time you should see the wrong email addres appear after the Invalid... text. If this does not occur you have modified the wrong file.
That's weird, I just tested with a fake mailadress with an _ : this one 'lady_lady@lycos.nl' and then it does work.
So when the _sign is in the middle at not before the @ it works properly.
Maybe this helps finding an solution?
I modified the file, this message appears now:
The following errors occured while processing your form input. Invalid email address entered: hermail_@hotmail.com
(I changed it for her privacy, but it's the adress I send you earlier. I've send the link to the form in a email (or should I've put it here?)
p.s. I deleted the other 'double' folders, I think I did it correctly, because it all still works :-)
OK so show me again how you modified this file with the change I gave you.
This change should work. I'm just not sure why it does not work for you.
I think I see what happened. Give me a minute to make a change.
Wow! Your still helping me out, you're the best!
I received two mails just now! With two mailadresses, one with two _ signs , and one without it
OK, when I was testing I added one underscore that I know would work with the old check function. Then I added the second underscore to check the new function. What I failed to do is remove the first underscore after testing the second successfully. The failure occured again because you only had one trailing underscore (the condition I missed).
Try this modification to the last check function.
Change the email check function to this:
The modification is in the 3rd set of []'s.
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+[_\\-]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
I'm becoming crazy, I still get the message with the entered mailadress in it. I don't know if you need to see it, but I'll paste my process.php again:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Naam');
pt_register('POST','Email');
$Email=trim($Email);
pt_register('POST','Telefoonnummer');
pt_register('POST','Website');
pt_register('POST','Vragenofopmerkingen');
$Vragenofopmerkingen=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Vragenofopmerkingen);if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+[_\\-]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
$error.="<li>Invalid email address entered:".$Email;
$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="Naam: ".$Naam."
Email: ".$Email."
Telefoonnummer: ".$Telefoonnummer."
Website: ".$Website."
Vragen of opmerkingen: ".$Vragenofopmerkingen."
";
$message = stripslashes($message);
mail("mymail@lycos.nl","Form Submitted at your website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.vincents.nl/bedankt.htm");
?><?php
}
?>
This is really weird, I also tried the fake mailadress that you used earleir, just to be sure it also works when I try it, her_mail_@hotmail.com... And than one also works, just still not the one I send you
OK, fails for me to. Let me use this one as an additional test case.
Third time's the charm. It's best to cut and paste so you don't miss anything. Just be careful of line breaks. This should be one continuous line.
if(!eregi("^[a-z0-9]+([_\\.-]*[a-z0-9]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
Thanks for your help anyway! I'll check into Paypal, because I should really donate something after tonight! As long as you try to find the problem :-)
But what's best to do now? Maybe my sister is the only one with such a weird mailadress, but I can't risk the mail not working when unknown visitors get this message while entering their adress...
Create a new form and make it a text box instead of email? Or can I make this change in the existing form?
I hope you'll find the solution when you use this as an test case! I'm actually kind of releived that I wasn't being totally stupid! How will I know if you've found the solution?
Ok, unfortunaly without the solution... it's bedtime, it's 3.15 here and I have to get up early :-(
Hi TNTEverett,
Amazing! Could it be that I found the solution?? I didn't want to give up, but I don't know anything about PHP and all the codes, so I was just trying some things in de changes you gave me last night. And the first thing I tried was this change:
if(!eregi("^[a-z0-9]+([a-z0-9]+[_\\-]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
I deleted the second set of []'s of the last you gave me last night:
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+[_\\-]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
And now I get all the mails from the fake adresses like her_mail_@hotmail.com, her_@hotmail.com, her_mail@hotmail.com. It doesn't seem to matter now where the _ is.
Is this the right modification? Or am I breaking any 'php-rules' with this one?
if(!eregi("^[a-z0-9]+([_\\.-]*[a-z0-9]*)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
This is the one that should work. Did you try this one?
Finally it works!
My solution wasn't that great, because I found out while testing than the mailadresses with a . didn't work...
Yours works! Thank you so, so, so much!