PHP TypeKey

| 10 Comments | 6 TrackBacks

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.


6 TrackBacks

PHP TypeKey from Movalog Sideblog on November 18, 2004 4:53 AM

PHP TypeKey... Read More

Finally! There is a decent implementation for authentication using Type Key which you can download a copy of the Auth_Typekey which Daiji Hriata wrote. Looks way better than the PECL module called Auth_Typekey which I've been developing in my free... Read More

Neil's World - PHP TypeKey How to make your Individual Archives use PHP for the TypeKey information instead of... Read More

Busty Mousepads Mousepads for $25 with gel wrist rests. Shaped like boobs. Attached to a hentai girl. [via sexblo.gs] (categories: funny sex) To dance,... Read More

Dumping from Bryce Yehl on December 28, 2004 4:29 AM

I didn't buy the LCD television I wanted for Christmas because I kept reading that prices will decline after the... Read More

Hace unos días leí en Neil’s World este artículo, donde se explica la manera de sustituir el codigo javascript que gestiona la validación mediante el servicio TypeKey por codigo PHP. Las ventajas que esto supone son evidentes, por un lado... Read More

10 Comments

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.

Powered by Movable Type 4.34-en

About this Entry

This page contains a single entry by Neil T. published on November 17, 2004 9:44 PM.

Got viruses? No internet for you... was the previous entry in this blog.

What geek decade are you? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives