Wow, your PHP coder friend sure was a lot of help with that advice
Anyway, it's too hard to tell exactly what could be the problem with just the information you've provided, but I recommend if your member.php is barely modified with hacks, then just to replace it with the original. If it is modified to an extent you don't feel like replacing, then I would try comparing the unmodified member.php and your version.
But first, let's try to help you ....can you post a chunk of the code around line 1297, but NOT the entire member.php (as that's against rules).