Quick Question re: Windows/Linux PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm just curious, because I come across this from time to time.

Why does the code below work on Windows and not on Linux. PHP is 5.0 on
Linux and 4.4 on Windows (still can't get 5 on Windows). The code at the
very bottom is how I got it to work on Linux. Also, why is it with the same
setup I can't call a function within a function in Linux, but can in
Windows. Sorry I don't have the error, but something about calling a static
function. Would this be a difference between OS's or with the different
versions of PHP? 

Thanks

B

---------------------------

	if (empty($subemail)) { $form->setError($field, emailnotentered); 
		}
		else {
	         $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
	                 ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
	                 ."\.([a-z]{2,}){1}$";
	         if(!eregi($regex,$subemail)){
	            $form->setError($field, emailinvalid);
	         }
         $subemail = stripslashes($subemail);
		}
		elseif(in_array(strtolower($a), $language))
$form->setError($field, profanity);
		elseif(in_array(strtolower($b), $language))
$form->setError($field, profanity);
		elseif(in_array(strtolower($c), $language))
$form->setError($field, profanity);
        else {
           $query = "SELECT * FROM users WHERE $subemail = 'email'";
           $result = mysql_query($query)or $mysqlerror = mysql_error();
           if ($mysqlerror) {
                   $form->setError($field, tberror);
           }
           else {
              $numrows = mysql_fetch_row($result);
              if($numrows = mysql_num_rows($result)) {
                      $form->setError($field, duplicatepassword);
              }
           }
        }

---------------------------

  $field = "email";
  list ($a, $b, $c) = split ('[@.]', $subemail);
  $regex =
"^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{1,})*\.([a-z]{2,}){1}
$";

  if (empty($subemail)) { $form->setError($field, emailnotentered);
  }
  elseif(!eregi($regex,$subemail)){
            $form->setError($field, emailinvalid);
  }
  elseif(in_array(strtolower($a), $language)) $form->setError($field,
profanity);
  elseif(in_array(strtolower($b), $language)) $form->setError($field,
profanity);
  elseif(in_array(strtolower($c), $language)) $form->setError($field,
profanity);
                        
  else {   
           $query = "SELECT * FROM users WHERE $subemail = 'email'";
           $result = mysql_query($query)or $mysqlerror = mysql_error();
           if ($mysqlerror) {
                   $form->setError($field, tberror);
                
           }
           else {
              $numrows = mysql_fetch_row($result);
              if($numrows = mysql_num_rows($result)) {
                      $form->setError($field, duplicatepassword);
              }
           }
        }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux