We study a new numerical technique for the solution of two-dimensional problem of viscous flow in a rectangular domain bounded by two moving porous walls. The fluid can enter or exit when the walls expand or contract. Using some proper change of variables, the problem is converted to a nonlinear fourth order boundary value problem. Based on differential quadrature method, a new algorithm is developed to approximate the solution. Sixth degree spline basis functions are used to construct the algorithm. Some error bounds are obtained theoretically. The results of the numerical experiments show the good performance of the algorithm.