TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Paavo....

Page: 1 2 Reply
Nov 30th 2002#80403 Report
Member since: Nov 26th 2001
Posts: 2586
I am trying to get an email validation in php to work. What I have is a working php/html mail form that I got off Robouk's site. But I cant seem to get the validator and whether someone entered anything to work.
I guess I am confused where the validator validates, you know? I have 4 pages, one with the form, one that has the php code that processes the info, one that says "sorry" if its wrong, and one that says "Thanks" if it's right. So somewhere in the form page? or in the Process page I have to insert the validation code, but I am not sure where,. so that it works.

http://www.mardala.com/mail.php is the link if you want to see what I am talking about.

You are the script master so I am calling on your skills =)
Reply with Quote Reply
Nov 30th 2002#80406 Report
Member since: Mar 24th 2002
Posts: 3114
Uhm...you need to regExp the string entered, and besides, Joe is the PHP king on the board. :D

However, the way I'd do it in a hurry, and being lazy as I am, I'd just make a strchr($string,"@")ANDstrchr($string,".") in the value of the input field.. somewhere.

I'm too tired to think right now, and I bet PowerfulSwuid's got something up his sleeve on this one, so I'll just wait 'till tomorrow. :D
Reply with Quote Reply
Nov 30th 2002#80414 Report
Member since: Nov 26th 2001
Posts: 2586
The regExp code is what I am confused about where to put it.... I took it out, but I tried putting it before the form in php angle brackets and it didnt do anything, I also tried inserting it on the actual php processing page and it didnt do anything. All the scripts I have seen have both the email and the validator, but not together. I havent been able to get it to work....
But.... oh well. I need a scotch. hehe....
Reply with Quote Reply
Nov 30th 2002#80423 Report
Member since: Apr 1st 2002
Posts: 1487
*sings the mighty mouse theme, "HERE HE COMES TO SAVE THE DAAAAY!" :p *

just put this in the page that has all the PHP code in it. it should work.

[PHP]
if (!ereg("^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
{
echo "Not a valid e-mail.";
exit;
}
else
{
echo "Valid e-mail.";
exit;
}
[/PHP]
Reply with Quote Reply
Nov 30th 2002#80489 Report
Member since: Aug 25th 2001
Posts: 1619
Poopy squid! even I knew this one. I was gonna cover it but you beat me to the chase...
Reply with Quote Reply
Nov 30th 2002#80490 Report
Member since: Apr 1st 2002
Posts: 1487
yea, suuuuuuure you did :p

oh, and btw, marble, if you don't understand what all that does, here's a good tutorial i had to follow when i first started that, my book doesn't seem to give enough good information on these.

http://www.crazygrrl.com/weav/regex.php3
Reply with Quote Reply
Nov 30th 2002#80503 Report
Member since: Nov 26th 2001
Posts: 2586
Thanks Squid =)
Reply with Quote Reply
Nov 30th 2002#80504 Report
Member since: Apr 1st 2002
Posts: 1487
no problem. so, did it work? or do you still need to try it?
Reply with Quote Reply
Nov 30th 2002#80506 Report
Member since: Nov 26th 2001
Posts: 2586
I need to try it... i just woke up and I have to head out for a bit. But I will let you know when I get it working =)
Reply with Quote Reply
Nov 30th 2002#80507 Report
Member since: Apr 1st 2002
Posts: 1487
ahh.
Reply with Quote Reply
Page: 1 2 Back to top
Please login or register above to post in this forum