Jump to content


Photo

donation code valadation for newbies


  • Please log in to reply
2 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 11 July 2006 - 02:42 PM

I have been studying the regular exspresions all week, and know i understand it quite well heres a free example good luck.



<?

//tempary web address.

//$web_address="www.google.com";

//function web_address($web_address) {

//if(eregi("^(www)+\.+[a-z]+\.+[a-z]+(\.+[a-z]{2})?$",$web_address)){

//echo "Correct web address!";
//}else{
//echo "Wrong web address!";
//}
// }

//returning the function.

//web_address($web_address);


?>

<?

//tempary email address

//function email_address($email) {

//$email_address="me@me.com";

//if(eregi("^[a-z0-9]+@[a-z0-9_\-\]+\.+[a-z0-9]+(\.+[a-z].)?$",$email_address)) {

//echo " Correct Email address";

//}else{

//echo " Wrong email address";

//}
// }

//returning function

//email_address($email);

?>
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 11 July 2006 - 02:44 PM

You'd probably wan't to check for http:// too

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 11 July 2006 - 03:23 PM

sorry there you go you can have http:// or www. or both lol full url or subdomain

<?

//tempary web address.

$web_address="www.google.com";

function web_address($web_address) {

if(eregi("^(http://|www.)+[a-z]+\.+[a-z]+(\.+[a-z]{2})?$",$web_address)){

echo "Correct web address!";
}else{
echo "Wrong web address!";
}
 }

//returning the function.

web_address($web_address);


?>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users