The paper deals with the problems for the sine-Gordon and sinh-Gordon equations on a half-line: with the given initial and boundary conditions: The Dirichlet initial-boundary-value problem (IBVP) (1), (3), (4) is associated with the scattering problem (SP) for the system J = diag(1, − 1), u = (u1, u2), with the boundary condition: The Dirichlet IBVP (2)–(4) is associated with the SP for the system: with the boundary condition (6).We apply a formalism of the direct and inverse SP (5), (6) ((7), (6)) to investigate the considered IBVPs. The difficulty associated with these problems is that the time dependence of the scattering data set s of the SP is determined by unknown boundary values (BVs) at x = 0 of the Jost solutions of (5) ((7)) and more, the evolution equations for BVs contain unknown boundary data (BD). We overcome this difficulty in the following way. We show that the evolution of the BD is described by a linear Volterra integral equation, the solution of which is found in terms of the given (3) and (4). Then the BVs are calculated in terms of (3) and (4). We find the necessary and sufficient conditions on the quantities of the data set s which ensure a unique solution of the inverse problem. Therefore, the antiderivative of the recovered potential is the solution of the considered IBVP.