13:59 Mon Sep  3, 2007
Cheap Hummer!

12:18 Tue Jul  4, 2006
Hummer Camp After

12:15 Tue Jul  4, 2006
Hummer Camp

Help Me Humpa
PHP and MMS Server Help
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to ignore case?

 
Post new topic   Reply to topic    Help Me Humpa Forum Index -> Anything PHP
View previous topic :: View next topic  
Author Message
Phree



Joined: 31 Dec 2005
Posts: 254
Location: South Coast, UK

PostPosted: Tue Sep 26, 2006 5:58 pm    Post subject: How to ignore case? Reply with quote

Hi Humpa,

hope everything's well with you.

Once again, I'm tailoring the email to site...It's working really well, but what I'm trying to figure out is how to ignore the case of an email address. Our emails at work are Firstname.Surname@mywork.com - note the capital letter at the start of each. In the code I have, I tried putting this:

Code:

if ($postedfrom == "firstname.surname@mywork.com") {
$postedfrom="Phree";
}


And it didn't like it because I didn't use the capital letters. So I thought that if I used:

Code:

if (eregi($postedfrom == "firstname.surname@mywork.com")) {
$postedfrom="Phree";
}


That would work - but still it didn't. It didn't work until I put:
Code:

if (eregi($postedfrom == "Firstname.Surname@mywork.com")) {
$postedfrom="Phree";
}


Could you please point me in the right direction? I know I could just use the capital letters in the right place, but I'd like to implement the right way to do things to avoid future problems.

Thanks icon30

Off-topic as well, but I was talking to the old lady next door last weekend (she's 76). She was sat out in the front garden with her new camera - she's always had cameras and it's one of her loves. Anyway, I asked her what it was and she told me it was a Nikon. After speaking to you a while ago about the Nikons, I tried to BS my way through things, I ask her, "Oh right, D50 or D70?"..."Oh no, this is the D80" she says Shocked I tried telling her it was too much camera for her and she should do the right thing and let me have it, but she was having none of it! Nice nice camera.
Back to top
View user's profile Send private message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Tue Sep 26, 2006 6:02 pm    Post subject: Reply with quote

Nice!
Yeah, D80 is kinda new, I think?
Mine is old now I guess. But it is going to get a work out in 4 weeks at Fantasy Fest - I'm going to Key West with my father again for that. Very Happy

Code:
if (eregi("firstname.surname@mywork.com", $postedfrom)) {
   $postedfrom="Phree";
}
Back to top
View user's profile Send private message
Phree



Joined: 31 Dec 2005
Posts: 254
Location: South Coast, UK

PostPosted: Tue Sep 26, 2006 6:07 pm    Post subject: Reply with quote

Sweet! Thanks Smile

Oooh! Another Fantasy Fest! I look forward to the pics from there Wink Hope you get another one as good as this Smile

I believe the D80 is new yeah and I think she paid around £800(uk) for it. When she gets the hang of it, I'll get some pics off her and post them up to show you if you like?
Back to top
View user's profile Send private message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Tue Sep 26, 2006 7:27 pm    Post subject: Reply with quote

I should do better this year.
I know what to expect - and I have more memory cards. Razz
Plus, I'm that much closer to being a dirty old man! Homer
Back to top
View user's profile Send private message
Phree



Joined: 31 Dec 2005
Posts: 254
Location: South Coast, UK

PostPosted: Wed Sep 27, 2006 6:22 pm    Post subject: Reply with quote

Humpa wrote:

Plus, I'm that much closer to being a dirty old man! Homer



I think we're all dirty old men at heart Laughing

I've been having a bit of a think about the code you helped me with last night...I've built up the list now to add the 'authorized addresses' - there's only 9 or 10 addresses in there, but I'm wondering about security. Spiders can trawl my site and find those addresses right? If so, would it be wise to somehow code the addresses differently to stop them - and if so, how would you advise the best way to do it?

Is there a way of doing something like:

Code:

$firstbit = "firstname.surname";
$secondbit = "@";
$lastbit = "mywork.com";
if (eregi($firstbit . $secondbit . $lastbit, $postedfrom)) {
   $postedfrom="Phree";
}

Question And if that worked, would you say it's a better way of doing things?
Back to top
View user's profile Send private message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Wed Sep 27, 2006 6:36 pm    Post subject: Reply with quote

I'm not sure.
Where are the addresses?

If you wrote "if" clauses for everyone, then that strips out the address, doesn't it?
Or do you not have an "if" clause for everyone?

No one can see your php code, if that is what you are asking.
Back to top
View user's profile Send private message
Phree



Joined: 31 Dec 2005
Posts: 254
Location: South Coast, UK

PostPosted: Wed Sep 27, 2006 6:41 pm    Post subject: Reply with quote

Excellent. That was precisely what I was asking - can anyone see my php code. I was a tad concerned because some people use the email to site from their works addresses (as I do) and I didn't want their inbox to suddenly get flooded with offers of viagra Smile I guess spiders grab the email addresses differently then? If I had a contact page that actually says on screen, "To contact me, email me@thisaddress.com" then they can grab that?

I did indeed write "if" clauses for each address.

Thanks again Humpa..."You da best!"
Back to top
View user's profile Send private message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Wed Sep 27, 2006 7:09 pm    Post subject: Reply with quote

Spiders can't see anything that you can't see.
They see the source code - the HTML source code. Your server processes the php pages and sends it to the browser, spider, whatever. Everyone gets the same thing.
And spiders can only see pages that you can see too - if you have links to pages, the spider will crawl that link. They can't just crawl around the site, they can only crawl the html source code - that's all they can do.
They have no special powers. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Help Me Humpa Forum Index -> Anything PHP All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum