This is something I've kept meaning to do but never got around to implementing - using PHP instead of JavaScript for managing TypeKey user information on the comments forms.
The current method is, to me, a bit of a hack. It involves calling a CGI script to read a cookie which checks to see if the user is signed in, and then some document.write() statements to vary the look of the comment form depending on whether the user is signed in to TypeKey or not. This can all be done using PHP.
Update: PHP-TypeKey is now located here.

Great work, I implemented it and the pages are loading super fast now compared to before. You may just want to change the script above, in dynamic templating mode, you can’t use <? you’ll need to use <?php
Also this doesn’t seem to work properly in dynamic publishing mode because MTRemote tags are being taken literally, I’m trying to find a way to get this to work in dynamic templating system…
This is only slightly related. I’m seeking some advice and i respect Neil enough to take his advice seriously.
I do a fair amount of back-end website stuff for a contractor. All of the code i’ve done has been an asp.net / sql-server combo. But the guy i do the work for is actually pretty flexible as long as the site works. On an xp machine IIS is handicapped to such an extent that developing web applications on a single machine is painfully slow moving to say the least. On top of this i’m hoping to migrate to a powermac in the near future (or maybe march 2005 haha)
I want to start developing with php+mysql instead, so that i’m not trapped in a microsoft jail cell.
I’ve worked with a vast number of languages so it shouldn’t be a struggle, but the php documentation in the past has put me off learning enough to be considered a rapid developer, especially where database manipulation is concerned.
So anyway, from what i gather you are an expert in these fields and a good judge of well written simplicity. Can you recommend a good site of textbook that covers php in an intelligent business oriented manor?
(Sorry that that was so long winded, i wanted to explain my reasons first…come to think of it, maybe this would have been better in an email)
Neil, does this work with dynamic templates? What about the safeREF plugin?
The SafeHREF plugin is not dynamic-compatible, as far as I know. As for the rest of the code, it should work if you replace <? with <?php .
I think you can use encode_html=”1” instead of SafeHREF plugin.
No, you can’t - I tried :( .
Hmm… this is weird, I can’t get it to work for me. I will email you my template. Maybe you can see something I am missing.
For the others having the problem I was using a free SSL domain through my host https://koldarknet.secure.powweb.com for all CGI, and I ended up having to use AdminCGI in mt.cfg for my admin interface, to get it to work properly with http://www.koldark.net. I am not sure if it is a bug with how Neil is handling things or if it is somewhere else. But I now have it working.
I figured out your validation issue, and it should work with dynamic templates (untested).
<?php $commentername = $_COOKIE["commenter_name"]; if ($commentername) { echo('Thanks for signing in, ' . $commentername . '. Now you now can comment. (<a href="' . htmlentities('<$MTRemoteSignOutLink static="1"$>') . '">sign out</a>)'); } else { echo('If you have a TypeKey identity, you can <a href="' . htmlentities('<$MTRemoteSignInLink static="1"$>') . '"> sign in</a> to use it here.'); } ?>htmlentities is a PHP function that encodes the URL. I use this other places. I have verified that it works on my site.