PCRE's (Perl-Compatible Regular Expressions) are a little different than the original ereg_*() versions.
The answer to your specific question is:
<?php
if( !preg_match( '/\.html$/i',$ref ) ){
$ref = $ref.'.html';
However, there is another issue to consider:
If your script uses this function in one spot, it probably uses it in other places as well. You might be chasing and fixing similar errors for some time.
Even though you're "not a coder," it would be worth your while to do a little learning if you're the one who has to fix everything. Trust me, if you don't know what you're doing, you can cause a lot of major problems trying to fix a minor one.
[edit] dang it! NogDog strikes again! 🙂 [/edit]