PHP Classes

eregi error

Recommend this page to a friend!

      ISBN check  >  All threads  >  eregi error  >  (Un) Subscribe thread alerts  
Subject:eregi error
Summary:finds 979 anywhere in isbn
Messages:2
Author:Nat Herold
Date:2010-12-22 00:40:43
Update:2012-02-28 18:04:56
 

  1. eregi error   Reply   Report abuse  
Picture of Nat Herold Nat Herold - 2010-12-22 00:40:55
this:
if ( eregi("979", $this->isbn13) )

needs to be changed; my suggestion is:

if ( preg_match("/^979.*?/", $this->isbn13) )

otherwise it finds '979' anywhere in an isbn; e.g. throws an error if the isbn is a valid '9780393979213'

  2. Re: eregi error   Reply   Report abuse  
Picture of Keith Nunn Keith Nunn - 2012-02-28 18:04:56 - In reply to message 1 from Nat Herold
Thanks for the suggestion. I'll try to update the script soon. Sorry I haven't been paying much attention to it, I don't personally have any real use for it at present. I'll try to pay more attention to the forum here.

Keith