JohnnearCfon
9 years ago
"This is of course impossible!" :lol:
grahami
9 years ago
Once upon a time, I could program in machine code, various forms of BASIC, PASCAL, C, C+ and even C++ but this is all greek to me!

Grahami
The map is the territory - especially in chain scale.
ebgb
  • ebgb
  • 50.2% (Neutral)
  • Newbie
9 years ago
"SimonRL" wrote:



Recoding the entire site in PHP would be a bit of an undertaking :lol:



we get sooper new things in php like...

if(!filter_var($email, FILTER_VALIDATE_EMAIL))
{
exit("E-mail is not valid");
}

which does exactly what it says on the tin

shove it into an array in bits. I used variations of this loads, regex in 2 goes:

// Split it into sections to make life easier
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++) {
if
(!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&
?'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$",
$local_array[$i])) {
return false;
}
}
// Check if domain is IP. If not,
// it should be valid domain name
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2) {
return false; // Not enough parts to domain
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if
(!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|
?([A-Za-z0-9]+))$",
$domain_array[$i])) {
return false;
}
}
}
return true;
}

good coders write good code - great coders steal it!
exspelio
9 years ago
Err-- What, exactly does it 'say on the tin'?????
Always remember, nature is in charge, get it wrong and it is you who suffers!.
Roy Morton
9 years ago
"exspelio" wrote:

Err-- What, exactly does it 'say on the tin'?????



Can cause drowsiness.........:lol:
"You Chinese think of everything!"
"But I''m not Chinese!"
"Then you must have forgotten something!"
sinker
  • sinker
  • 50.2% (Neutral)
  • Newbie
9 years ago
"Roy Morton" wrote:

"exspelio" wrote:

Err-- What, exactly does it 'say on the tin'?????



Can cause drowsiness.........:lol:




:lol: :lol: :thumbsup: :stupid:
Yma O Hyd....
JohnnearCfon
9 years ago
"Roy Morton" wrote:

"exspelio" wrote:

Err-- What, exactly does it 'say on the tin'?????



Can cause drowsiness.........:lol:



Classic!!! :lol::thumbsup::lol::thumbsup::lol:

Disclaimer: Mine exploring can be quite dangerous, but then again it can be alright, it all depends on the weather. Please read the proper disclaimer.
© 2005 to 2023 AditNow.co.uk

Dedicated to the memory of Freda Lowe, who believed this was worth saving...