Restricting a User to enter Valid Data
Moderator: General Moderators
-
Kakumanuprince
- Forum Newbie
- Posts: 3
- Joined: Sat Aug 12, 2006 1:20 am
- Contact:
Restricting a User to enter Valid Data
Hi,
Can you please help me on how to restrict a User to not allow him to enter a other Mail ID's in MSN Mail ID Text box
Thank You
Can you please help me on how to restrict a User to not allow him to enter a other Mail ID's in MSN Mail ID Text box
Thank You
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Restricting a User to enter Valid Data
hi
Kakumanuprince wrote:Hi,
Can you please help me on how to restrict a User to not allow him to enter a other Mail ID's in MSN Mail ID Text box
Thank You
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
-
Kakumanuprince
- Forum Newbie
- Posts: 3
- Joined: Sat Aug 12, 2006 1:20 am
- Contact:
Restricting a User to enter valid Data
Hi,Everah wrote:Please explain this a little better.
Thank You for your concern
As You might have seen in the Registration form of this very same forum We have two fields "MSN Messenger" and "Yahoo Messenger" and these fields accept any Mail ID as valid data for ex. if I enter my gmail Acc or Rediff acc. or Sify Acc. in this field, It is accepting as a valid mail ID. Can I restrict the User not to enter such ID's and make him only enter the Hotmail ID in "MSN Messenger" field and Yahoo ID in the "Yahoo Messenger" Field
Thank You
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Code: Select all
<?php
if ( !strstr($_POST['mail_id'], 'hotmail.com') )
{
die('We cannot accept anything other than a hotmail.com email address');
}
?>- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: ANY INFO
What? What does this mean?lohitha wrote:did u get any replies clarifying the doudt
-
fastfingertips
- Forum Contributor
- Posts: 242
- Joined: Sun Dec 28, 2003 1:40 am
- Contact:
I suppose that you would like to force the user to enter same email ID in his contact and also in the MSN messenger field. In this case you should make a double validation, first one on the user side using JavaScript and the second one on server through PHP.
The php validation should look like:
The php validation should look like:
Code: Select all
if(strcasecmp($_POST['user_email'],$_POST['user_email_msn']))
{
//Error message here
}