A short but tricky question on Sylow theorem and semidirect product 
Let $G:=H \rtimes_{\phi} K$, $\phi: K \to \mathrm{Aut}(H)$ and is homomorphic. There is only one $p$-Sylow subgroup of $G$ (denoted by $P$). $p$ divides $|\phi(K)|$. Prove $p$ divides $|H|$. 

*This is a homework question that I got stuck for a long while. I'm not looking for someone to solve this for me but any hint on how to use $p\mid|\phi(K)|$ will be appreciated. My attempt so far: $|G|=p^am$. Assume $H$ does not have $p$ as a prime divisor, $|K|=p^an$ so $P \unlhd K$. Then I don't know what to do. I tried many random things but I just can't see where contradiction lies
 A: This is a nice problem.
To comment on your existing approach, I would note that you have deduced the conclusion $P \unlhd K$ from the much stronger hypothesis $P \unlhd G$. But $P \unlhd K$, by itself, is too weak to proceed further. You can see this by considering the example $H = C_2 \times C_2$, $K = C_3$, $p=3$. Let $\phi$ be a nontrivial action of $K$ on $H$ (it is easy to see that one exists).  All the hypotheses are satisfied except $P \unlhd G$, while $P \unlhd K$ is true, yet the conclusion fails.  So at some point, you will have to use the full hypothesis $P \unlhd G$ again.
The hypothesis $p\mid|\phi(K)|$ does not come in until later.
Here's the key lemma, which is not difficult to prove:

Lemma: In the semidirect product $G = H \rtimes_{\phi} K$, if $K$ is a normal subgroup of $G$, then the action of $\phi$ is trivial.

(Just to be clear: By definition, $H$ is always a normal subgroup of $H \rtimes_{\phi} K$; in the lemma, we're assuming that the other group, $K$, is normal.)
I'll let you take it from here.
A: The following is a full solution to this problem. The key to unlock this is to use "$p | |\phi(K)|$" via First Isomorphism theorem. Please do not look at the solution if you are in the same class as I do (Read Ted's answer instead, which did not give away much). Any critique of the proof is highly welcomed. 
Denote normal p-sylow subgroup of $G$ as $P$. Assume $p$ does not divide $|H|$. Then it must be that $|K|=p^a n$ where $(n,p)=1$ since $|G|=p^a m=|K||P|$ where $(m,p)=1$. So $K$ must contain a normal Sylow $p-$subgroup $P'$. Then $(1,K) \le G$, which is isomorphic to $K$, must also contain a normal Sylow $p-$subgroup. By Sylow theorem, there can be only one normal Sylow $p-$subgroup in $G$. So, $P \le (1,K)$. $P=(1,P')$ because $(1,P')$ is normal subgroup of $(1,K)$ of order $p^a$. 
Since $P \unlhd (1,K) \le G$ and $(H,1) \unlhd G$, $(H,1) \cap P=1$. So $(H,1)P \le G$ and $|(H,1)P|=|H||P|$.    Let $G'=H \rtimes_{\psi}P'$ where $\psi: P' \to Aut(H)$ and for any $k \in P', \psi(k)=\phi(k)$. $\psi$ is well defined because $P' \le K$. We know $\psi$ is homomorphic since $\phi$ is homomorphic: for any $k_1,k_2 \in P' \le K$, $\psi(k_1 k_2)=\phi(k_1 k_2)=\phi(k_1)\phi(k_2)=\psi(k_1) \psi(k_2)$. Therefore $G'$ is a group, and because $G' \subseteq G$, $G' \le G$. $(1,P')=P \unlhd G$ and therefore $(1,P')\unlhd G'$ and so $\psi$ must be a trivial: for any $k \in P', \psi(k)=\phi(k)=1$. Therefore, $P' \le \ker(\phi)$ by which $|\ker(\phi)|=p^aw$, for some $w \in N^{+}$ by Lagrangian theorem
By first isomorphism theorem, $|\phi(K)|=|K|/|\ker(\phi)|=p^{a}n/(p^aw)=n/w$. But since $(n,p)=1$, $p$ does not divide $\phi(K)$, thus contradiction.
