Valid email - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Valid email (
/showthread.php?tid=615918)
Valid email -
MerryDeer - 29.08.2016
It's possible to check if input email is valid? i mean it's created in website gmail.com, yahoo.com and in any other?
Re: Valid email -
DarkSkull - 29.08.2016
I don't think so. But you can check if the player has entered a valid email though.
Eg:
someone@example.com is valid
someone.com is not valid
someone@s is not valid
Re: Valid email -
SoLetsGO - 29.08.2016
You could also check if the e-mail provider is valid. So you have a list of many e-mail providers which you found.
like gmail,freenet,aol etc. Then you make an array of them and when a play enters the e-mail you check if the e-mail provider is listed in the array.
Re: Valid email -
Sanady - 29.08.2016
Only what you can detect about that is domain of email company and format (something@domain.com) that`s all.
Re: Valid email -
Vince - 29.08.2016
Quote:
Originally Posted by SoLetsGO
You could also check if the e-mail provider is valid. So you have a list of many e-mail providers which you found.
like gmail,freenet,aol etc. Then you make an array of them and when a play enters the e-mail you check if the e-mail provider is listed in the array.
|
That's really a dumb solution, to be honest. I have an e-mail address under my own domain, which will surely not be in your array.
The most thorough solution is a regular expression. But if you don't want to use that plugin you can probably also get by using sscanf, using something like:
PHP код:
"{s[256]'@'s[256]'.'s[256]}"
Since it's a quiet expression (curly braces) string size does not matter.