Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
How to check for valid email, i want to check specific player can write any name xxxxxx/ but website from where create email i want specify, like gmail, yahoo, inbox and what i want
Posts: 723
Threads: 366
Joined: Jun 2016
No body give me function
I found at least:
Code:
stock IsCorrectMail(mail[])
{
new len = strlen(mail), bool:find[2], w;
if(!(6 < len < 129)) return false;
for(new l; l < len; l++)
{
if(mail[l] == '.') find[0] = true;
if(mail[l] == '@')
{
if(find[1]) return false;
find[1] = true;
w = l;
if(w > 64) return false;
}
if(!(mail[l] >= 'A' && mail[l] <= 'Z' || mail[l] >= 'a' && mail[l] <= 'z' || mail[l] >= '0' && mail[l] <= '9' || mail[l] == '.' || mail[l] == '-' || mail[l] == '_' || mail[l] == '@')) return false;
}
if(len - w > 65) return false;
if(!find[0] || !find[1]) return false;
return true;
}
But how to upgrade this function how i mention check i want allow just from @gmail.com, @yahoo.com just some what i specified.
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Loop, find @, break loop, compare string starting at the index after @ with the ones you specify.
You could also use strfind to get the index.
Posts: 723
Threads: 366
Joined: Jun 2016
Can you remake this function for me?
Posts: 723
Threads: 366
Joined: Jun 2016
respect from me
this too will be usefull for others users
Posts: 723
Threads: 366
Joined: Jun 2016
if(!strcmp(email[at_pos], providers[i], true))
{
This take not just email[at_pos] only @ letter?
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Everything after @.
Show some respect, and say "thank you mighty dad"!
Posts: 6,242
Threads: 8
Joined: Jun 2008
I'm sure Vinces example worked a little bit... Just a little bit...