Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Advanced recordset, splitting in two?

Posted 03 May 2007 16:25:22
1
has voted
03 May 2007 16:25:22 Matthew Cooper posted:
Not quite sure it the title is the best way to describe this but here goes

I have created a refer a contact page, basically with name lastname and email address etc, the person that is referring a colleague is already logged in of course. Now the email field must match the domain of the person who is already logged in. So basically if is referring someone it will only work if everything after the "@" is the same domain. Anyone know if its possible to validate this somehow? or even create 2 fields and somehow pull through only the domain name from from the recordset, and have the 1st field editable then a @ with a greyed out txtbox with thier domain name in?

Thanks

Mat

Replies

Replied 03 May 2007 17:30:17
03 May 2007 17:30:17 Alan C replied:
am I right in saying that is already logged in, so you know their id

you could split the string of their name with one of the php functions so that you are left with just the part after the @

having got that do you want to verify that as a genuine domain name? Somewhere I once saw an email address checking function that actually went and checked that there was an MX record for the domain name, but where did I see it??

Anyway - once you have the domain like mydomain.com you could put it into the textbox as an initial value, or better, put it as grey text after the textbox so there is no way that the user can change it. You would probably have to keep a lot of this in a session - as this post is in the asp section I am not sure how you do that.

Hope that makes sense <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic