I just uploaded a site, which I just finished and I went through testing to make sure it all worked on the web host. And whenever I added a listing or edited a listing the script would stop. I would get no error, just the script will stop. The whole site works perfectly (to my knowing) on my own test server.

By trial and error, I managed to narrow the problem down to my use of validation class. This is the same class I also use on the signup form, which works fine there. This is the code, I have put comment markings in where I commented the code out for it to work.

Joel wrote:I just uploaded a site, which I just finished and I went through testing to make sure it all worked on the web host. And whenever I added a listing or edited a listing the script would stop. I would get no error, just the script will stop.

At exactly which line in the script does it "stop"? You can figure this out by trial-and-error just by echoing something at various places in the script and see which is the last line that the echo can be on and still show up.

It was this function, and I realise now str_word_count is only available after PHP 4.3.0 and this host is running 4.2.2

I suppose I can do something the same thing using explode, in fact it may even be a better way of doing it. I'll race you to the function finish. If you're wondering why I need this function: it's because some 'internet vandals' like to hold down letters like this...

which ruins the whole layout of a page, like it does on PHPBB2. So this function will stop people from doing that.

This is indeed a nasty thing for people to do, and it's good of you to anticipate it. Another thing you can do is in your HTML use the CSS overflow attribute to force the page to hide anything that extends beyond the intended edge of the element.

Also, in writing your script, don't forget that \t and \n also count as word boundaries, in addition to space.