Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HELP! Again. I seem to have some padding I can't get rid of and a PHP problem.

Reply
Thread Tools

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

 
 
Mike Barnard
Guest
Posts: n/a
 
      03-25-2008
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
 
 
 
 
Els
Guest
Posts: n/a
 
      03-26-2008
Mike Barnard wrote:

> 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.

> 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
 
 
 
 
Ben C
Guest
Posts: n/a
 
      03-26-2008
On 2008-03-25, Mike Barnard <(E-Mail Removed)> wrote:
> 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.

> 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
 
Mike Barnard
Guest
Posts: n/a
 
      03-26-2008
On Wed, 26 Mar 2008 08:57:24 +0100, Els <(E-Mail Removed)>
wrote:

>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.

>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
 
John Hosking
Guest
Posts: n/a
 
      03-26-2008
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.)

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
 
Els
Guest
Posts: n/a
 
      03-26-2008
John Hosking wrote:

> 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
 
Neredbojias
Guest
Posts: n/a
 
      03-26-2008
On 26 Mar 2008, John Hosking <(E-Mail Removed)> 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.

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      03-26-2008
On 26 Mar 2008, Neredbojias <(E-Mail Removed)> wrote:

>> 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.)


On second thought, maybe the _range_ "A-Z" actually _is_ causing a
problem... It would have to be checked and I don't have the time now.

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
 
Reply With Quote
 
Els
Guest
Posts: n/a
 
      03-26-2008
Neredbojias wrote:

> On 26 Mar 2008, John Hosking <(E-Mail Removed)> 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
 
John Hosking
Guest
Posts: n/a
 
      03-27-2008
Neredbojias wrote:
> 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
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
Can't seem to get rid of the padding laredotornado@zipmail.com HTML 6 10-20-2007 08:48 PM
Is there someone have written some programs about RSA-1024?I have some question. dolphin C++ 3 03-09-2007 02:47 PM
Error downloading page, some pages work great but cant seem to get this one Jack Schafer Perl 1 04-23-2004 08:32 AM
tried 'padding' and 'margin' but do not seem to work Sharon Lee HTML 2 12-31-2003 05:53 AM



Advertisments