![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
|
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? |
#3
| |||
| |||
|
|
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. |
#4
| |||
| |||
|
|
Mike Barnard wrote: Becaues the h* elements have margin. Set margin:0; on that h5, and it's gone. |

|
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>"; } |
#5
| |||
| |||
|
|
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>"; } |
#6
| |||
| |||
|
|
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.) |
#7
| |||
| |||
|
|
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. |
#8
| |||
| |||
|
|
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.) |
#9
| |||
| |||
|
|
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. |
#10
| |||
| |||
|
|
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. |
|
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? |
![]() |
| Thread Tools | |
| Display Modes | |
| |