Location: PHPKode > projects > Replex > replex-0.9.0/lib/libfunction.php
<?php
/*************************************************************
$Id: libfunction.php,v 1.1 2001/05/08 21:14:37 jimir Exp $
 
 ***************************************************************/

  # -- HTTP REDIRECT --
  function HTTPRedirect($location, $target=NULL)
  { 
    Header("Location: $location");
    if ($target) {
      Header("Window-target: $target");  
    }
    Header("HTTP/1.0 302 Found");
    print "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
           <HTML><HEAD>
           <TITLE>302 Found</TITLE>
           </HEAD><BODY>
           <H1>Found</H1>
           The document was found <A HREF=\"$url\">here</A>.<P>
           </BODY></HTML>
           ";
    exit;	
  }


   function is_array_empty($array) {
     for($a=0;$a<count($array);$a++) {
       if(!$array[$a]=="" || !empty($array[$a]))
       return 0;
     }
     return 1;
   }
   
   function isEmailValid($email) {
     if(!eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](g|l|m|pa|t|u|v)?$",$email)) {
       return 0;
     }
     else
     return 1;
  }

  function isAliasValid($alias) {
     if(!eregi("^[0-9a-z]([-_.]?[0-9a-z])*$",$alias)) {
       return 0;
     }
     else
     return 1;
  }

  
?>
Return current item: Replex