Jump to content

checking if email and username has same thing.


brown2005

Recommended Posts

Hi, I had a function for this, but I can not find it, so I was wondering if anybody could please help.

i have to inputs

email
username

what i want is say someone has

email = '[email protected]'
username = 'myemail4751?'

i want this not to be allowed as they have entered the whole of the email before the @.

any ideas please of a function/code?
email = '[email protected]'
username = 'myemail4751?'

that is invalid because the username has used myemail which is in the email address.

anything that is totally different is valid, i.e.

email = '[email protected]'
username = 'ruggedlady3242'
I dont think it's a good idea doing that. For an example, all of my email addresses contain "orio" in them. If I would see I cant use the combination of Orio as the username and an email containing orio in it, I'd simply wouldnt register.
But if you still want to apply something like that, you can use the [url=http://www.php.net/strpos]strpos()[/url] function:
[code]if(strpos($email, $user) !== FALSE) die("The email cant contain the username!");[/code]

Orio.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.