[Fwd: RE: [PHP] Quick Question re: Windows/Linux PHP]
but what would I do with my life once I 'got it'? Original Message It would be nice if you read some of my other threads regarding PHP5 before opening your mouth and saying something stupid. People like you are the reason why I don't post very often to these lists. I would rather struggle for days with it than listen to some halfwit like you who's got nothing better to do. Get a life moron. -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: July 1, 2006 6:41 AM To: Beauford Cc: php-general@lists.php.net Subject: Re: [PHP] Quick Question re: Windows/Linux PHP Beauford wrote: > 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 what stops you from installing php5 on windows? - it's not like it's very difficult. > very bottom is how I got it to work on Linux. Also, why is it with the > same ah yes good of you to point out which line(s) you changed. > 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 if your too lazy to run the code one more time to copy and paste the error then why should anyone help you? > function. Would this be a difference between OS's or with the > different versions of PHP? it's something to do with fact that OO in php4 is a world away from OO in php5. > > 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 ('[EMAIL PROTECTED]', $subemail); > $regex = > "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)[EMAIL PROTECTED](\.[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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick Question re: Windows/Linux PHP
Beauford wrote: > 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 what stops you from installing php5 on windows? - it's not like it's very difficult. > very bottom is how I got it to work on Linux. Also, why is it with the same ah yes good of you to point out which line(s) you changed. > 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 if your too lazy to run the code one more time to copy and paste the error then why should anyone help you? > function. Would this be a difference between OS's or with the different > versions of PHP? it's something to do with fact that OO in php4 is a world away from OO in php5. > > 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 ('[EMAIL PROTECTED]', $subemail); > $regex = > "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)[EMAIL > PROTECTED](\.[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
Re: [PHP] Quick Question re: Windows/Linux PHP
On 7/1/06, Beauford <[EMAIL PROTECTED]> wrote: 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? You'll have to narrow down what you're having issues with before anyone will take a look. Is it the regex? Is it lines x -> y? Of course you can call a function within a function in linux. We can't help debug that without at least the code and the error. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick Question re: Windows/Linux PHP
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 ('[EMAIL PROTECTED]', $subemail); $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)[EMAIL PROTECTED](\.[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