Remember the TradingEye hack? It's because they didn't escape the username and password for the login. I rest my case

Thanks Sarah, and thanks for the code I'll update what I've used.
Are you getting paid to update this script? If not then leave it. You were commissioned several years ago to create what you've done and, whilst it wasn't best practice even then, it was quite common to do. The site owners have to appreciate that technology updates and you can't predict the future. This is why you charge for fixing sites broken by the latest version of IE.
I put the script together nearly ten years ago based on tutorials I found on some of the most reputable sites around at the time and a big PHP/MySQL book I bought. I think it was the way to go in those days, and at the time commercial/open source systems were almost non-existent.
I'm not getting paid for it, no, and they probably only paid shirt buttons for the site in the first place. I'm also updating another 4 sites of similar vintage on the server.
I know theoretically I should be charging for it, but to be honest it's not worth the backlash. A few hours work versus hours of emails and bad feeling. Three of the site owners have muttered about updating their systems recently and had rough quotes so I don't want to fall out with them at this stage, and it's nice having the hosting income too.
Of course if they go and have a new site built with someone else my cunning plan will have failed again but it's par for the course this year.