| View previous topic :: View next topic |
| Author |
Message |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Tue Sep 26, 2006 5:58 pm Post subject: How to ignore case? |
|
|
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
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 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 |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Tue Sep 26, 2006 6:02 pm Post subject: |
|
|
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.
| Code: |
if (eregi("firstname.surname@mywork.com", $postedfrom)) {
$postedfrom="Phree";
} |
|
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Tue Sep 26, 2006 6:07 pm Post subject: |
|
|
Sweet! Thanks
Oooh! Another Fantasy Fest! I look forward to the pics from there Hope you get another one as good as this
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 |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Tue Sep 26, 2006 7:27 pm Post subject: |
|
|
I should do better this year.
I know what to expect - and I have more memory cards.
Plus, I'm that much closer to being a dirty old man!  |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed Sep 27, 2006 6:22 pm Post subject: |
|
|
| Humpa wrote: |
Plus, I'm that much closer to being a dirty old man!
|
I think we're all dirty old men at heart
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";
}
|
And if that worked, would you say it's a better way of doing things? |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed Sep 27, 2006 6:36 pm Post subject: |
|
|
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 |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed Sep 27, 2006 6:41 pm Post subject: |
|
|
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 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 |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed Sep 27, 2006 7:09 pm Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
|