Existence results for second-order boundary-value problems with variable exponents