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
  #1  
Old   
Mike Barnard
 
Posts: n/a

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






No, not my spare tyre, although thats true too.

www.thermachek.co.uk/

On the contact page if I look at it with Firefox I get huge amounts of
padding around the telephone number. Looking at it in IE it looks OK.
Why, please?

I have just thought, is it the famous "IE collapses margins but others
don't" bug? Because I don't see much margin or padding to collapse in
the css.

As for the PHP problem, I have downloaded a freebie php script for a
spam free email contact form. This is where it came from...

http://www.stevedawson.com/article0015.php

I have butchered it slightly, but not the basic code, just the excess
table stuff. The problem is that a valid email address I entered as a
test returns as invalid. Can anyone tell me if the script is any good
and worth persevering with or is there better somewhere?

OK, here I go again, off to the land of nod. 5 past 11 at night. But I
think I'm slowly getting there.

Thanks all. G'night.


Reply With Quote
  #2  
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-26-2008 , 03:57 AM






Mike Barnard wrote:

Quote:
No, not my spare tyre, although thats true too.

www.thermachek.co.uk/

On the contact page if I look at it with Firefox I get huge amounts of
padding around the telephone number. Looking at it in IE it looks OK.
Why, please?
Becaues the h* elements have margin. Set margin:0; on that h5, and
it's gone.

Quote:
As for the PHP problem, I have downloaded a freebie php script for a
spam free email contact form. This is where it came from...

http://www.stevedawson.com/article0015.php

I have butchered it slightly, but not the basic code, just the excess
table stuff. The problem is that a valid email address I entered as a
test returns as invalid. Can anyone tell me if the script is any good
and worth persevering with or is there better somewhere?
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>";
}

--
Els http://locusmeus.com/


Reply With Quote
  #3  
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-26-2008 , 04:25 AM



On 2008-03-25, Mike Barnard <m.barnard.trousers (AT) thunderin (DOT) co.uk> wrote:
Quote:
No, not my spare tyre, although thats true too.

www.thermachek.co.uk/

On the contact page if I look at it with Firefox I get huge amounts of
padding around the telephone number. Looking at it in IE it looks OK.
Why, please?

I have just thought, is it the famous "IE collapses margins but others
don't" bug?
I don't know about that famous bug, but for future reference Firefox
etc. do collapse top and bottom margins between blocks mostly correctly
as specified in CSS 2.1.

Quote:
Because I don't see much margin or padding to collapse in
the css.
Padding never gets collapsed, only top and bottom margins.


Reply With Quote
  #4  
Old   
Mike Barnard
 
Posts: n/a

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



On Wed, 26 Mar 2008 08:57:24 +0100, Els <els.aNOSPAM (AT) tiscali (DOT) nl>
wrote:

Quote:
Mike Barnard wrote:


Becaues the h* elements have margin. Set margin:0; on that h5, and
it's gone.
DOH! Again.

Thanks for pointing out the obvious to me.

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>";
}

True, this is the part, but I haven't worked it out and it doesn't
show which of the possible errors has caused the invalidity.

Oh well, off to the php reference sites to try and work it out.

Thanks.


Reply With Quote
  #5  
Old   
John Hosking
 
Posts: n/a

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



Els wrote:
Quote:
Mike Barnard wrote:


www.thermachek.co.uk/


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>";
}
I'm not only not a wizard, I'm not even a sorceror's apprentice. But it
seems to me this regexp is overly sensitive to case. (It looks to me as
if it doesn't like lowercase characters in the address.)

Mike: what happens when you captilaize the entire e-mail address?
Or: what happens when you steal a different e-mail validity regex from
somewhere else on the Web?


--
John
Read about the UIP: http://improve-usenet.org/


Reply With Quote
  #6  
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-26-2008 , 01:07 PM



John Hosking wrote:

Quote:
Els wrote:
Mike Barnard wrote:


www.thermachek.co.uk/


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>";
}

I'm not only not a wizard, I'm not even a sorceror's apprentice. But it
seems to me this regexp is overly sensitive to case. (It looks to me as
if it doesn't like lowercase characters in the address.)
I thought the i in eregi meant 'insensitive'...

--
Els http://locusmeus.com/


Reply With Quote
  #7  
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-26-2008 , 01:15 PM



Neredbojias wrote:

Quote:
On 26 Mar 2008, John Hosking <John (AT) DELETE (DOT) Hosking.name.INVALID> wrote:

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>";
}

I'm not only not a wizard, I'm not even a sorceror's apprentice. But it
seems to me this regexp is overly sensitive to case. (It looks to me as
if it doesn't like lowercase characters in the address.)

Er, the "i" in "eregi" indicates case-insensitivity. (Sorry to be pedantic
but it's hard to get one-up on you.)

Also, I "studied" the regex and could find nothing definitely wrong
although not sure about the use of the circumflex there. And I'm far from
an "expert", too.
circumflex means 'at the start', just like $ means 'at the end'
(although I'm sure the way I just described that would invoke a
correction from a Jukka like PHP person ;-))

Here's one from another script I sometimes use:
if
(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$",strtolower($c['email'])))
{
echo "That is not a valid e-mail address.";
}

No idea why they didn't just use eregi and got rid of strtolower
though...

--
Els http://locusmeus.com/


Reply With Quote
  #8  
Old   
John Hosking
 
Posts: n/a

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



Neredbojias wrote:
Quote:
On 26 Mar 2008, John Hosking wrote:

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>";
}
I'm not only not a wizard, I'm not even a sorceror's apprentice. But it
seems to me this regexp is overly sensitive to case. (It looks to me as
if it doesn't like lowercase characters in the address.)

Er, the "i" in "eregi" indicates case-insensitivity. (Sorry to be pedantic
but it's hard to get one-up on you.)
Hey, no problem; I don't believe I've ever even *heard* of eregi before.
See how much I know about regular expressions? I just learned something,
so there's no reason to apologize.

(Correction: it's _impossible_ to get one-up on me. ;-) )


--
John
Now, I wouldn't mind being a *pinball* wizard.


Reply With Quote
  #9  
Old   
Jonathan N. Little
 
Posts: n/a

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



John Hosking wrote:
Quote:
Neredbojias wrote:
On 26 Mar 2008, John Hosking wrote:

Er, the "i" in "eregi" indicates case-insensitivity. (Sorry to be
pedantic but it's hard to get one-up on you.)

Hey, no problem; I don't believe I've ever even *heard* of eregi before.
See how much I know about regular expressions? I just learned something,
so there's no reason to apologize.

It's a PHP thing, the developers of PHP evidentially never heard of
functions arguments so you have to have a zillion functions for ever
possible application of a function, unlike terse Perl.

Ex: Perl's sort vs PHP's sort, asort, rsort, ksort, and on and on....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #10  
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 , 03:03 AM



Neredbojias wrote:
Quote:
On 26 Mar 2008, Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote:
Neredbojias wrote:
Er, the "i" in "eregi" indicates case-insensitivity. (Sorry to be
pedantic but it's hard to get one-up on you.)

Also, I "studied" the regex and could find nothing definitely wrong
although not sure about the use of the circumflex there. And I'm far
from an "expert", too.

circumflex means 'at the start', just like $ means 'at the end'
(although I'm sure the way I just described that would invoke a
correction from a Jukka like PHP person ;-))

That I was aware of, but what I don't know is why it would be necessary in
that expression. Wouldn't the code-line work without it, starting at the
beginning automatically? If not, I am at a loss to explain why.
Without the ^, this string would be accepted as well:
!!NOT AN EMAIL ADDRESS!!!!info (AT) example (DOT) org
Email addresses aren't allowed to start with a dot or dash or anything
that's not a-z0-9.

Quote:
Here's one from another script I sometimes use:
if
(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{
2,6})$",strtolower($c['email']))) {
echo "That is not a valid e-mail address.";
}

No idea why they didn't just use eregi and got rid of strtolower
though...

Me, neither, but 2 things. This line _has_ the lowercase a-z, the
_content_ of which is, of course, necessary, and it also has the beginning
circumflex. I'd sure like to see that explained... Also, does:

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

include a-z or not?
I think it does. But that's just me thinking :-)

--
Els http://locusmeus.com/


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.