This paper investigates the influence of both viscous and joules dissipation on the problem of magnetohydrodynamic flow past a stretching porous surface embedded in a porous medium. Analytic solutions of the resulting nonlinear non-homogeneous boundary value problem in the case when the plate stretches with a velocity varying linearly with distance, expressed in terms of confluent hypergeometric functions, are presented for the case of prescribed surface temperature. Numerical calculations have been carried out for various values of suction parameter, magnetic field, Prandtl number, Eckert number and Schmidt number. The results show that increases in magnetic parameter decrease both the dimensionless transverse velocity, longitudinal velocity and also the skin friction coefficient. Also, formation of thin boundary layer is observed for higher value of magnetic parameter.