In this paper, we consider the initial-boundary value problem of the 3D primitive equations for planetary oceanic and atmospheric dynamics with only horizontal eddy viscosity in the horizontal momentum equations and only horizontal diffusion in the temperature equation. Global well-posedness of strong solution is established for any $H^2$ initial data. An $N$-dimensional logarithmic Sobolev embedding inequality, which bounds the $L^\infty$ norm in terms of the $L^q$ norms up to a logarithm of the $L^p$-norm, for $p>N$, of the first order derivatives, and a system version of the classic Gronwall inequality are exploited to establish the required a priori $H^2$ estimates for the global regularity.