Seems to indicate that you only flank if you can threaten, and if you only threaten if you can make melee attacks.
Meh. You're right, of course, but there are several corner-cases where the edges get a bit blurry... One that leaps to mind is Distracting Ember, the Swordsage maneuver. On the one hand, you summon a Fire Elemental explicitly to "threaten" an opponent so that you or an ally can gain the benefits of flanking. On the other hand, the creature - also explicitly - can take no actions
or attacks of opportunity during the time it manifests (i.e. for the duration of your turn), and therefore in a very real way doesn't threaten. Except it does. Ow.
There are other spells or effects that do similar things, I'm sure, but I can't cudgel my tired brains into enough order to think where to look for them. In any case, I believe the precedent to be set: Distracting Ember summons into being something that can't attack but can "threaten" an opponent. It's a threat purely because the opponent believes it could be...
As such, I've certainly ruled in exactly the same way as Marius describes: if the opponent believes in a "flanking" illusion, their attention is sufficiently distracted as to provide the +2 bonus to hit. If they don't believe it, they can ignore it... although of course, if they choose to ignore a flanking opponent who turns out to be real, that's
bad.
Conversely, I've always gone with the optional-unofficial-house-rule take on ignoring flankers (by exactly the same rationale):
"You can disregard attacks from an opponent flanking you. When you do, that opponent doesn't get the +2 flanking bonus when attacking you and that opponent does not provide a flanking bonus to any of its allies. Ignoring a flanker, however, provokes an attack of opportunity from that flanker, and you lose your Dexterity bonus to Armor Class against that flanker. You do, however, continue to threaten that flanker."
I first introduced this primarily for the benefit of monsters who were immune to one or more of the PC's attacks, where it was just weird that they could be "flanked" by someone who absolutely couldn't hurt them... Naturally, my group then made great (ab)use of said rule by the creative use of illusions. One bright spark had the idea of introducing a bunch of unconvincing illusory party rogues identical to the original so the bad guys would get used to the concept and ignore the real one (who was also subject to illusory "fuzzing") when he finally waded in.
I was so impressed at the resulting carnage that I gave them extra XP for the encounter