HighDots Forums  

HELP! Again. I seem to have some padding I can't get rid of and a PHP problem.

alt.html alt.html


Discuss HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Els
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 11:54 AM






Neredbojias wrote:

Quote:
eregi("[A-Z]+");

include a-z or not?

I think it does. But that's just me thinking :-)

Me, too.
See Ben's reply :-)

Quote:
And thanks for uploading the nice pics.
Only one! the rest is NOT mine - not taking responsibility for those
<g>

--
Els http://locusmeus.com/


Reply With Quote
  #22  
Old   
Bergamot
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of anda PHP problem. - 03-27-2008 , 12:59 PM






Ben C wrote:
Quote:
On 2008-03-27, Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote:

Sounds like the safest bet would be to use A-z ?

That's a good idea, although I don't have total confidence that it's
either AaBbCc... or ABC...abc... and not some other other strange order
in some locales.
Locale is irrelvant. It's just ASCII. You can find the order in any
ASCII chart. There are many around the web.

--
Berg


Reply With Quote
  #23  
Old   
Els
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 02:50 PM



Blinky the Shark wrote:

Quote:
Els wrote:

Toby A Inkster wrote:

Els wrote:

Which special chars are between Z and a then? Noob here - I just
thought it would either go AaBbCc.. or ABC...XYZabc...xyz ?

There are six characters between 'Z' and 'a': [\]^_`

Thanks - I had no idea.. :-)

http://www.asciitable.com/
Shows I'm not a real geek - that's the first time I ever saw an ASCII
table. (not counting the ones I wrote myself by starting at ALT-128 so
I had a list for the occasional é and ç back when I was a typist...)

--
Els http://locusmeus.com/


Reply With Quote
  #24  
Old   
Blinky the Shark
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 03:27 PM



Els wrote:

Quote:
Toby A Inkster wrote:

Els wrote:

Which special chars are between Z and a then? Noob here - I just
thought it would either go AaBbCc.. or ABC...XYZabc...xyz ?

There are six characters between 'Z' and 'a': [\]^_`

Thanks - I had no idea.. :-)
http://www.asciitable.com/

--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net



Reply With Quote
  #25  
Old   
Els
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 04:00 PM



Blinky the Shark wrote:
Quote:
Els wrote:

Shows I'm not a real geek

snip

You can be. Just stick with us.
Been doing that for ehm... [counting on fingers..] 5 years already -
didn't help much yet! :-)

Okay - I didn't count on my fingers, I had to look it up in Google
groups, and the oldest post I can find of myself in this group, was in
August 2003. Funny thing though, Jukka is in that thread too, and he
is so friendly and helpful! I'm almost tempted to read back the last 5
years of alt.html posts to see what went wrong ;-)

--
Els http://locusmeus.com/


Reply With Quote
  #26  
Old   
Els
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 04:02 PM



Neredbojias wrote:

Quote:
Okay, I've scoured the php manual and apparently the following insert if
designated as caseless:

[A-Z]

will indeed include a-z. In some foreign languages that have umlauts and
other gazinckisses, such letters may be also included.
Okay, good to know.

Quote:
And thanks for uploading the nice pics.

Only one! the rest is NOT mine - not taking responsibility for those

Really? I wonder who uploaded the foggy sun and vale one? Anyway, there
was quite a rush last night, and it was interesting.
You should have captured IP addresses - then compare them to IP
addresses in the group's posts ;-)

Quote:
(PS: Did you see Blinky's behemoth killer shark?)
Yup, I did :-)

--
Els http://locusmeus.com/


Reply With Quote
  #27  
Old   
Blinky the Shark
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 04:07 PM



Els wrote:

Quote:
Blinky the Shark wrote:

Els wrote:

Toby A Inkster wrote:

Els wrote:

Which special chars are between Z and a then? Noob here - I just
thought it would either go AaBbCc.. or ABC...XYZabc...xyz ?

There are six characters between 'Z' and 'a': [\]^_`

Thanks - I had no idea.. :-)

http://www.asciitable.com/

Shows I'm not a real geek
<snip>

You can be. Just stick with us.


--
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net



Reply With Quote
  #28  
Old   
Michael Fesser
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 04:09 PM



..oO(Els)

Quote:
I'm no PHP wizard, nor do I know much about regexp, but for those who
are, this is the part in the script that seems to check the email
address:

// Check the email address enmtered matches the standard email address
format
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)) {
echo "<p>It appears you entered an invalid email address</p><p><a
href='javascript: history.go(-1)'>Click here to go back</a>.</p>";
}
Just two notes:

1) Using such checks should be done carefully. A proper RFC-compliant
address check _cannot_ be done with such a simple regex. Almost every
regex I saw will still allow many invalid addresses and reject valid
ones. The RFC 822 is a quite complex beast.

Mail::RFC822::Address: regexp-based address validation
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

PHP : Parsing Email Adresses in PHP
http://www.iamcal.com/publish/articl...parsing_email/

The second one seems to work quite well, but still is not fully RFC-
compliant (but should be enough in most cases, though).

2) The ereg_* functions are dead and will be removed in PHP6. The preg_*
(PCRE) functions are the way to go and much more powerful and efficient.

Micha


Reply With Quote
  #29  
Old   
Els
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 04:20 PM



Michael Fesser wrote:

Quote:
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)) {

Just two notes:

1) Using such checks should be done carefully. A proper RFC-compliant
address check _cannot_ be done with such a simple regex. Almost every
regex I saw will still allow many invalid addresses and reject valid
ones. The RFC 822 is a quite complex beast.

Mail::RFC822::Address: regexp-based address validation
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

PHP : Parsing Email Adresses in PHP
http://www.iamcal.com/publish/articl...parsing_email/
I think I like this one better than the Perl one.. easier to see if I
made a typo <g>

Quote:
The second one seems to work quite well, but still is not fully RFC-
compliant (but should be enough in most cases, though).

2) The ereg_* functions are dead and will be removed in PHP6. The preg_*
(PCRE) functions are the way to go and much more powerful and efficient.
Thanks for the heads up :-)

--
Els http://locusmeus.com/


Reply With Quote
  #30  
Old   
Ben C
 
Posts: n/a

Default Re: HELP! Again. I seem to have some padding I can't get rid of and a PHP problem. - 03-27-2008 , 05:01 PM



On 2008-03-27, Bergamot <bergamot (AT) visi (DOT) com> wrote:
Quote:
Ben C wrote:
On 2008-03-27, Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote:

Sounds like the safest bet would be to use A-z ?

That's a good idea, although I don't have total confidence that it's
either AaBbCc... or ABC...abc... and not some other other strange order
in some locales.

Locale is irrelvant. It's just ASCII. You can find the order in any
ASCII chart. There are many around the web.
I'm pretty sure the value of LC_COLLATE will affect whether [A-Z]
matches "b" or not (assuming case-sensitive, otherwise it will always
match "b") in many programs.

In the egrep manual:

Within a bracket expression, a range expression consists of two
characters separated by a hyphen. It matches any single character
that sorts between the two characters, inclusive, using the locale's
collating sequence and character set. For example, in the default C
locale, [a-d] is equivalent to [abcd]. Many locales sort characters
in dictionary order, and in these locales [a-d] is typically not
equivalent to [abcd]; it might be equivalent to [aBbCcDd], for
example. To obtain the traditional interpretation of bracket
expressions, you can use the C locale by setting the LC_ALL
environment variable to the value C.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.