PHP and hiveware_enkoder

Posted by Pierre Igot in: Technology
November 26th, 2004 • 8:59 am

Like many other web designers, I have to deal with spam issues and do whatever I can do to minimize the problem. One of the fundamental strategies to avoid spam in the first place is to never post e-mail addresses in clear text on web pages. It’s too easy for spammers to scan web pages and collect everything that looks like an e-mail address to add it to their mailing lists.

So I use Automatic Labs’ Enkoder Form, which generates a small script that “hides” the e-mail address from spammers, but makes it still possible for the reader of the web page in question to click on a link that creates a new e-mail message in his favorite e-mail client addressed to the intended recipient.

And the scripts generated by this Enkoder Form usually work fine. But today I encountered a rather obscure problem that forced me to switch to trouble-shooting mode. I am currently designing a web site that also uses some PHP, so I had to include the Enkoder scripts that I had generated for various e-mail addresses into a .php file.

It worked OK, until I included one particular Enkoder script. For some reason, the inclusion of this particular script in the .php file causes a server-side parsing error. The script in question looked like any other script generated by the Enkoder Form, but obviously there was something in that particular script that definitely doesn’t agree with PHP. As soon as I included the script in my file, I got a parsing error. As soon as I removed it from the file, the .php page loaded normally.

What was the problem? I suspect that it was some string of chracters somewhere in that particular script that was mistakenly parsed by PHP as some PHP script instruction — and of course it was a malformed instruction that causes a parsing error.

Since my knowledge of PHP is very limited, I have no idea what string of characters it might be. In any case, I just went back to the Enkoder Form and generated another script for this same e-mail address. The script was different, and after I included this new script instead of the old one, I no longer got a PHP parsing error.

However, I still had some weird problem with the page. The script was inside a table cell, and for some reason after including the new script, the table layout was mangled. The cell containing the script was missing, and the link generated by the script was actually applied to the text in the next cell on the next table row, which was moved to the right of the current row!

Finally, I tried to generate yet another script with the Enkoder Form, used this latest script instead, and everything was fine after that.

The conclusion here seems to be that PHP and the scripts generated by the Enkoder Form are not exactly on the best of terms. This is obviously way beyond my competence (I have no idea how the scripts work, and I know very little about PHP), but at least with a bit of patience there’s a way around it!

One Response to “PHP and hiveware_enkoder

  1. J. King says:

    If you like, mail me the (Enkoder) script in question and I’ll have a look. I suspect I know what the problem is, but I do wonder why Enkoder would do such a thing.

Leave a Reply

Comments are closed.